#include "../menu.h"
#include "../../user.h"
//#include "FileListEvent.h"
#include "../aw_sys_app.h"
#include "filenav.h"
#include "../logo_dat.h" 
#include "../aw_init_display.h"
#include "LogoEvent.h"
#include "filelistevent.h"
#include "../resource/string_dat.h"

#include <sys/types.h>
#include <aw_playlist2.h>
#include "gplayer_app.h"
#include "../menu.h"
#include <listop.h>
#include <app/avi/avi_sub.h>
#include "user.h"
#include "AVTimer.h"
#include "t_filelist.h"
#include "filenav.h"
#include "aw_app.h"
#include "../aw_sys_app.h"
#include "../aw_init_display.h"
#include "../aw_AVI_app.h"
#include "../aw_PIC_app.h"
#include "../aw_VOB_app.h"
#include "../aw_GPLAYER_app.h"
#include "../aw_RM_app.h"
#include "../aw_TXT_app.h"
#include "../fs_playlist.h"
#include "../aw_gui_app.h"
#include "NetmenuSetupEvent.h"
#include "img_upgrade.h"
#include "aw_config.h"
#include "ctrlconvert.h"
#include "NetmenuSetupEvent.h"
#include "DebugEvent.h"

#define FILE_INFO_LEN 240
#define fileinfostr_max 100
//#define FILENUMBER  7
#define SHOW_FILE_NAME_LENGTH  33
#define FILELIST_WIDE    490
#define TXT_CMD_SET_IMG_CHECK_FUN   (CM_APP_CUSTOMER_ADD + 0x1)

unsigned int upgrade_platformID;
char *g_item_name;
char upgrade_swVersion[16];
char upgrade_swBuildDate[16];
char upgrade_swVersion_str[40]=  "Version:  ";
char upgrade_swBuildDate_str[40]="BuildDate:  ";

char del_highlight = 0;
char upgrade_showctrl_flag = 0;
char UPGRADEFILE_STR[20];
INT8U del_flag = 0;
INT8U filelist_show_flag=0;
INT8U  FileMenuToSingle = 0 ;
INT8U Deleting_Flag = 0;
INT8U Cancel_Flag = 0 ;
INT8U FileListOnShowFlag = 0 ;
INT32U ONLYDIR_FLAG = 0;
int upgrade_flag=0;

//extern char gpFileList[FILENUMBER][SHOW_FILE_NAME_LENGTH] ;
extern char gCurFileName[MAX_DIR_PATH_LENGTH] ;
extern char gCurDirName[MAX_DIR_PATH_LENGTH] ;
extern char have_videoinfo_flag;
extern char fileshowtime[20];
extern INT8U ShowSixPicFlag;
extern INT8U WinTypeChoice;
extern INT8U CurrentOsdSize;
extern INT8U isMute;// Sound is Mute or UnMute
extern INT16U AudioStatus;
extern INT16U AudioStatus ;
extern INT16U JpegPlayStatus ;
extern INT32U Filelist_Bar_Str_len ;
extern unsigned char CurDriver[10] ;
extern unsigned char Volume_Value ; // 0 ~ 7
extern unsigned char Volume_Value;
extern int pic_slide_show_mode;
extern int MultiMenuToSingle;
extern INT8U LogoResum;
#ifdef ENABLE_NETWORK
INT8U playnextflg=0;
static INT8U notshowinfo=0;
#endif
extern FILEINFO file_info_onshow;
extern AUDIO_STREAM_INFO pInfo;
extern INT32S roll_string_timeout ;
extern VIDEO_INFO video_inf;

extern char* SpeTable_8[];

static INT8U WaitFor = 3;
static INT8U waitting = 0;
static INT8U showlogowait = 0;
static INT8U icon_copying_flag=0;
static INT8U save_pic_slide_show_mode=0;
static INT8U FileMaskFlag=7;
static INT8U file_status = 0 ;
static INT8U EnterSelect_flag=0;
static INT8U Copying_flag=0;
static INT8U OperationBtnCurHi;
static INT8U String_roll_state_file = UNROLL ;

static AVTimer_t caption_moving_timer_1 = 0;
static AVTimer_t caption_moving_timer_2 = 0;
static AVTimer_t caption_moving_timer_3 = 0;
static INT32U gCurrentDirFileNum = 0; // record total number of fiels in the current dir.
static INT32U gCurrentDirMusicNum = 0;
static int CurrentIndex=0;

const short FLvolume_level[8]={ 0, 0x3ff, 0x7ff, 0xfff, 0x1fff, 0x3fff, 0x5fff, 0x7fff};

extern void PicParaTrans(void);

extern void GetID3(char *file_name, ID3_Tag *pTag, int *file_size) ;

static void caption_moving_time_func_3(void *arg);
static void caption_moving_time_func_2(void *arg);
static void caption_moving_time_func_1(void *arg);

#ifdef TV_MODE_1080P	
	extern char *SpeTable_14[];
#endif
#ifdef TV_MODE_720P	
	extern char *SpeTable_14[];
#endif

extern struct tm * localtime(const time_t   *__timer);

void FormatFileName_StringCat(char* dest, char * src, int len) //C:/filename
{
		memset(dest, 0, len);
		strncpy(&dest[2], &src[6], len-2);
		dest[0] = src[5];
		dest[1] = ':';
}

void Cut_string(char *str)
{
    INT8U offset;
#ifdef TV_MODE_1080P	
	if(CurrentOsdSize==OsdSize1080p)
		offset = 240;
	else
#endif
#ifdef TV_MODE_720P	
	if(CurrentOsdSize==OsdSize720p)
		offset = 240;
	else
#endif
		offset = 0;
    INT32S word_width = FILE_INFO_LEN + offset,font_height, word_len, str_len ;
    str_len = AWGetTextSize(str, 0,&word_width,&font_height,&word_len, AWTF_ASCII) ;
    if((fileinfostr_max-1) > str_len) 
        str[str_len]= 0 ;
}


void FLupdateVolumeState(Volume)
{
	PHWND hwnd = AWFindWinCtrlByName(WinFileVolume);
	if(hwnd){
		AWShowWinControl(hwnd, 0) ;
		if((Volume>=0)&&(Volume<8)){
			switch(Volume){
				case 0:
					hwnd->draw_info[1].draw_data = (INT32U)ICON_VOLUME0 ;
					break;
									
				case 1:
					hwnd->draw_info[1].draw_data = (INT32U)ICON_VOLUME1 ;
					break;
					
				case 2:
					hwnd->draw_info[1].draw_data = (INT32U)ICON_VOLUME2 ;
					break;
					
				case 3:
					hwnd->draw_info[1].draw_data = (INT32U)ICON_VOLUME3 ;
					break;
					
				case 4:
					hwnd->draw_info[1].draw_data = (INT32U)ICON_VOLUME4 ;
					break;
					
				case 5:
					hwnd->draw_info[1].draw_data = (INT32U)ICON_VOLUME5 ;
					break;
					
				case 6:
					hwnd->draw_info[1].draw_data = (INT32U)ICON_VOLUME6 ;
					break;
					
				case 7:
					hwnd->draw_info[1].draw_data = (INT32U)ICON_VOLUME7 ;
					break;
					
				default:
					break;							
						
			} // end switch
		
		} // end if
		hwnd->draw_info[0].draw_data = (INT32U)ICON_SPEAKER ;
		hwnd->pClass->ClassProc(hwnd, WM_PAINT_DRAW_INFO, 0);
		hwnd->pClass->ClassProc(hwnd, WM_PAINT_DRAW_INFO, 1) ;
		hwnd->pClass->ClassProc(hwnd, WM_PAINT_FINISH, 0) ;
	} // end if	
}

void FLSetVolume(unsigned char Init_Flag)
{
	if(Init_Flag)
		SetAC3CtrlReg(3,0x7fff);
	else
		SetAC3CtrlReg(3,FLvolume_level[Volume_Value]);
		SetSoundLevelPara(Volume_Value);
}

int FLProcessVolume(int key)
{
	if((key==UOP_VOL_MINUS)&&(Volume_Value>0))
	{
		if(isMute == MUTE)
			isMute = UNMUTE ;
			
		if(GPIO_MUTE_STATUS)
			GPIO_MB_UNMUTE;
						
		Volume_Value--;
		FLSetVolume(0);
		FLupdateVolumeState(Volume_Value);
	}
	else if((key==UOP_VOL_PLUS)&&(Volume_Value<7))
	{
		if(isMute == MUTE)
			isMute = UNMUTE ;
			
		if(GPIO_MUTE_STATUS)
			GPIO_MB_UNMUTE;

		Volume_Value++;
		FLSetVolume(0);
		FLupdateVolumeState(Volume_Value);
	}
	
	return Volume_Value;	
}

void GetMusicInfoStr(INT32U item_str,char *item,int i,PHWND dir_hwnd){
	char *p_str,str_get[60];
	INT16U StrLen;
	
	//str_get = (char *)AVMem_umalloc(60) ;
	p_str = (char *)AWGetResource(item_str, &StrLen);
	StrLen = (StrLen < 50)?StrLen:50 ;
	strncpy(str_get, p_str, StrLen);
	str_get[StrLen] = 0 ;	

	sprintf(debug_string[i],"%s %s",str_get,item);
	//sprintf(debug_string[i],"%s",music_item) ;
	//AVMem_free(str_get);
	//AVMem_free(music_item);
	Cut_string(debug_string[i]);
	
	dir_hwnd->draw_info[i+1].draw_data = (INT32U)debug_string[i];
	return;
}

extern INT8U lanuage_set;
char *GetVideoMusicCodeTypeStr(INT32U item)
{
	switch(item)
	{
        case AUDIO_TYPE_WMA1:
            return "WMA1";
            
        case AUDIO_TYPE_WMA2:
            return "WMA2";
            
        case AUDIO_TYPE_MP3:
            return "MP3" ;
            
        case AUDIO_TYPE_MPEG12:
            return "MPEG";   //"MPEG12";
            
        case AUDIO_TYPE_PCM:
            return "PCM";
            
        case AUDIO_TYPE_MSADPCM:
            return "MSADPCM";
            
        case AUDIO_TYPE_IMAADPCM:
            return "IMAADPCM";
            
        case AUDIO_TYPE_ALAC:
            return "ALAC" ;
            
        case AUDIO_TYPE_ULAW:
            return "ULAW" ;
            
        case AUDIO_TYPE_ALAW:
            return "ALAW";
            
		case AUDIO_TYPE_FLAC:
            return "FLAC" ;
            
        case AUDIO_TYPE_AAC:
            return "AAC";
            
        case AUDIO_TYPE_RAWPCM:
            return "RAWPCM";
            
        case AUDIO_TYPE_MONOPCM:
            return "MONOPCM";
            
		case 0x2000:
		case AUDIO_TYPE_AC3:
		    return "AC3";
            
        case AUDIO_TYPE_COOK:
            return "RealAudio";
            
        case AUDIO_TYPE_RAAC:
            return "AAC";
            
        case AUDIO_TYPE_UNKNOW: 
		default:
            if(lanuage_set == LANGUAGE_CHINESE)
		        return "δ֪";
		    else
		        return "UNKNOW";
		    break;
	}

}
char *GetVideoCodeTypeStr(INT32U item)
{
	switch(item){
		case 1:return "NONE";
		case 2:return "MOV";
		case 3:return "AVI";
		case 4:return "VOB";
		case 5:return "MPEG";
		case 6:return "RM";
		case VIDEO_TYPE_MP4:return "MPEG4";
		case VIDEO_TYPE_DIVX:return "DIVX";
		case VIDEO_TYPE_XVID:return "XVID";
		case VIDEO_TYPE_MJPEG:return "MotionJPEG";
		case VIDEO_TYPE_REAL_8:return "RealVideo8";		
		case VIDEO_TYPE_REAL_9:return "RealVideo9";
		default:return file_info_onshow.file_type;
	}
}


void GetVideoInfoStr(INT32U item_str,INT32U item,INT8U i,PHWND dir_hwnd)
{   
	char *p_str,str_get[60];
	INT16U StrLen;
	
	p_str = (char *)AWGetResource(item_str, &StrLen);
	StrLen = (StrLen < 50)?StrLen:50 ;
	strncpy(str_get, p_str, StrLen);
	str_get[StrLen] = 0 ;	
	if(item_str == MOVIE_DUR_STR)
	{
		if(item!=0)
			sprintf(debug_string[i],"%s %d:%02d:%02d",str_get,item/3600,(item%3600)/60,item%60);
		else 
			sprintf(debug_string[i],"%s 0:00:00",str_get);
	}
	else if(item_str == AUDIO_TYPE_STR)
		sprintf(debug_string[i],"%s %s",str_get,GetVideoMusicCodeTypeStr(item));
	else if(item_str == VEDIO_TYPE_STR)		
		sprintf(debug_string[i],"%s %s",str_get, GetVideoCodeTypeStr(item));
	Cut_string(debug_string[i]);			
	
	dir_hwnd->draw_info[i+1].draw_data = (INT32U)debug_string[i];
}



extern unsigned char* get_file_info(char* filename);


PicTimeFormat(TimeInfo *pTime_pic_taken,void *timeget)
{
	TimeInfo *second=NULL;
	second=(TimeInfo *)timeget;
	memcpy(pTime_pic_taken->year,second->year,4*sizeof(char));
	memcpy(pTime_pic_taken->month,second->month,2*sizeof(char));
	memcpy(pTime_pic_taken->day,second->day,2*sizeof(char));
		
}

#if 1
void GetPicInfo_From_Filelist()
{	
	pic_disp_info_t * picinfo=NULL;
	char *p_str,str_get[60];
	INT16U StrLen;
	PHWND dir_hwnd = AWFindWinCtrlByName(WinFileInfoBKG) ;
	if(dir_hwnd == NULL)
		return;
	unsigned height,width;
	char date_taken[21];
	static TimeInfo Time_pic_taken;
	
					/*	get resolution info*/	
	picinfo = (pic_disp_info_t *) get_file_info(g_item_name); 
	p_str = (char *)AWGetResource(RESOLUTION_STR, &StrLen);
	StrLen = (StrLen < 50)?StrLen:50 ;
	strncpy(str_get, p_str, StrLen);
	str_get[StrLen] = 0 ;
	
	height = picinfo->height;
	width  = picinfo->width;
	if((height == 0)||(width == 0))
		sprintf(debug_string[3],"%s %s",str_get,"NONE");	
	else
		sprintf(debug_string[3],"%s %d X %d",str_get,width,height);
	Cut_string(debug_string[3]);
	
	dir_hwnd->draw_info[4].draw_data = (INT32U)debug_string[3];
	
					/*	get ISO speed info*/	

	p_str = (char *)AWGetResource(ISO_STR, &StrLen);
	StrLen = (StrLen < 50)?StrLen:50 ;
	strncpy(str_get, p_str, StrLen);
	str_get[StrLen] = 0 ;
	sprintf(debug_string[4],"%s ",str_get) ;
		
		
	if(picinfo->ISO_size == 0){
		p_str = (char *)AWGetResource(NONE_STR, &StrLen);
		StrLen = (StrLen < 50)?StrLen:50 ;
		strncpy(str_get, p_str, StrLen);
		str_get[StrLen] = 0 ;
		strcat(debug_string[4],str_get);
		}
	else		
		sprintf(debug_string[4],"%s%d",debug_string[4],*(picinfo->ISO_speed_rating));
		Cut_string(debug_string[4]);
	dir_hwnd->draw_info[5].draw_data = (INT32U)debug_string[4];

					/*	get date taken info*/	

	if(picinfo->time_info[0]!=0){
		
		PicTimeFormat(&Time_pic_taken,picinfo->time_info);
		sprintf(date_taken,"%.2s/%.2s/%.4s",Time_pic_taken.month,Time_pic_taken.day,Time_pic_taken.year);
		p_str = (char *)AWGetResource(DATE_TAKE_STR, &StrLen);
		StrLen = (StrLen < 50)?StrLen:50 ;
		strncpy(str_get, p_str, StrLen);
		str_get[StrLen] = 0 ;
		sprintf(debug_string[0],"%s ",str_get) ;
		strcat(debug_string[0],date_taken);
		Cut_string(debug_string[0]);
		dir_hwnd->draw_info[1].draw_data = (INT32U)debug_string[0];
	}
	AWPostMessage(dir_hwnd, WM_PAINT, 0) ;
}
#endif

void ShowFileInfor()
{
    char *p_str,str_get[60];
    char size_char[20];
    INT16U StrLen;
    INT32S key = UOP_NOP ;
	int fd;
    PHWND dir_hwnd = AWFindWinCtrlByName(WinFileInfoBKG) ;
    if(dir_hwnd == NULL)
	return;
	
	if ((fd = open((char*)g_item_name, O_RDONLY)) < 0){
		close(fd);
		dir_hwnd->draw_info[0].draw_data = (INT32U)ICON_FILELIST_INFO_BLANK;
		dir_hwnd->draw_info[1].draw_data = (INT32U)0;
		dir_hwnd->draw_info[2].draw_data = (INT32U)0;
		dir_hwnd->draw_info[3].draw_data = (INT32U)0;
		dir_hwnd->draw_info[4].draw_data = (INT32U)0;
		dir_hwnd->draw_info[5].draw_data = (INT32U)0;
		dir_hwnd->draw_info[6].draw_data = (INT32U)0;
		dir_hwnd->draw_info[7].draw_data = (INT32U)0;
		AWPostMessage(dir_hwnd, WM_PAINT, 0) ;
	}
	else{	
	close(fd);
	p_str = (char *)AWGetResource(FILE_DATE_STR, &StrLen);
	StrLen = (StrLen < 50)?StrLen:50 ;
	strncpy(str_get, p_str, StrLen);
	str_get[StrLen] = 0 ;
	sprintf(debug_string[0],"%s ",str_get) ;
	strcat(debug_string[0],fileshowtime);
	Cut_string(debug_string[0]);
	//AVMem_free(str_get);
	

#if 0
	str_get = AVMem_umalloc(60) ;
	p_str = (char *)AWGetResource(FILE_NAME_STR, &StrLen);
	StrLen = (StrLen < 50)?StrLen:50 ;
	strncpy(str_get, p_str, StrLen);
	str_get[StrLen] = 0 ;
	sprintf(debug_string[0],"%s ",str_get) ;
	strcat(debug_string[0],file_info_onshow.file_name);
	Cut_string(debug_string[0]);
	AVMem_free(str_get);
#endif
	//str_get = AVMem_umalloc(60) ;
	p_str = (char *)AWGetResource(FILE_SIZE, &StrLen);
	StrLen = (StrLen < 50)?StrLen:50 ;
	strncpy(str_get, p_str, StrLen);
	str_get[StrLen] = 0 ;
	sprintf(debug_string[1],"%s ",str_get) ;
	if(file_info_onshow.file_size<1024){
		sprintf(size_char,"%d",file_info_onshow.file_size);
		strcat(debug_string[1],size_char);
		strcat(debug_string[1],"BYTE");
	}
	else if(file_info_onshow.file_size>(1024*1024)){
		sprintf(size_char,"%.1f",file_info_onshow.file_size/(1024.0*1024.0));
		strcat(debug_string[1],size_char);
		strcat(debug_string[1],"MB");
	}
	else {
		sprintf(size_char,"%d",(file_info_onshow.file_size/1024));
		strcat(debug_string[1],size_char);
		strcat(debug_string[1],"KB");
	}
		Cut_string(debug_string[1]);
	//AVMem_free(str_get);
	
	if(have_videoinfo_flag == 0){
		//str_get = AVMem_umalloc(60) ;
		if((strncmp(file_info_onshow.file_type,"MP3",3) == 0)
			||(strncmp(file_info_onshow.file_type,"WMA",3) == 0))
			
			p_str = (char *)AWGetResource(MUSIC_TYPE_STR, &StrLen);
		else
			p_str = (char *)AWGetResource(FILE_TYPE_STR, &StrLen);
		
		StrLen = (StrLen < 50)?StrLen:50 ;
		strncpy(str_get, p_str, StrLen);
		str_get[StrLen] = 0 ;
		sprintf(debug_string[2],"%s ",str_get) ;
		strcat(debug_string[2],file_info_onshow.file_type);
		Cut_string(debug_string[2]);
		//AVMem_free(str_get);
																	//debug_string[2]:file type 	debug_string[1]:fsize
		dir_hwnd->draw_info[3].draw_data = (INT32U)debug_string[2];  // draw_info[3] filetype   draw_info[2] filesize
    }
	else
		dir_hwnd->draw_info[3].draw_data = (INT32U)0;
	
	dir_hwnd->draw_info[0].draw_data = (INT32U)ICON_FILELIST_INFO_BLANK;
#ifdef ENABLE_NETWORK        
        if(IsNetWorkDev())
            dir_hwnd->draw_info[1].draw_data = (INT32U)0;
        else
#endif        
	dir_hwnd->draw_info[1].draw_data = (INT32U)debug_string[0];

	p_str = (char *)AWGetResource(FOLDER_STR, &StrLen);
	StrLen = (StrLen < 50)?StrLen:50 ;
	strncpy(str_get, p_str, StrLen);
	str_get[StrLen] = 0 ;
	
	if(strncmp(file_info_onshow.file_type,str_get,6) == 0)
		dir_hwnd->draw_info[2].draw_data = (INT32U)0;
	else
		dir_hwnd->draw_info[2].draw_data = (INT32U)debug_string[1];
	
	dir_hwnd->draw_info[4].draw_data = (INT32U)0;
	dir_hwnd->draw_info[5].draw_data = (INT32U)0;
	dir_hwnd->draw_info[6].draw_data = (INT32U)0;
	dir_hwnd->draw_info[7].draw_data = (INT32U)0;
		
		
	/*******************************************************
						IMG file info
	*******************************************************/	

	
	if((strncmp(file_info_onshow.file_type,"IMG",3) == 0)){
		int fd;
		AML_ImageHeader headinfo;
		
		//headinfo = (AML_ImageHeader *)AVMem_umalloc(sizeof(AML_ImageHeader));
		memset(&headinfo, 0, sizeof(AML_ImageHeader));
		memset(upgrade_swVersion_str, 0, 40);
		memset(upgrade_swVersion_str, 0, 40);

		if ((fd = open((char*)g_item_name, O_RDONLY)) >= 0){
			read(fd,&headinfo,sizeof(AML_ImageHeader));
			upgrade_platformID = headinfo.platformID;					
			close(fd);
		

			//str_get = AVMem_umalloc(60) ;
			p_str = (char *)AWGetResource(FIRMWARE_VERSION_STR, &StrLen);
			StrLen = (StrLen < 50)?StrLen:50 ;
			strncpy(str_get, p_str, StrLen);
			str_get[StrLen] = 0 ; 	
		
			sprintf(upgrade_swVersion_str,"%s %s",str_get,headinfo.swVersion);
			//AVMem_free(str_get);

			sprintf(debug_string[3],"%s",upgrade_swVersion_str) ;
			Cut_string(debug_string[3]);

			//str_get = AVMem_umalloc(60) ;
			p_str = (char *)AWGetResource(FIRMWARE_DATE_STR, &StrLen);
			StrLen = (StrLen < 50)?StrLen:50 ;
			strncpy(str_get, p_str, StrLen);
			str_get[StrLen] = 0 ;

			sprintf(upgrade_swBuildDate_str,"%s %s",str_get,headinfo.swBuildDate);
			//AVMem_free(str_get);	

			sprintf(debug_string[4],"%s",upgrade_swBuildDate_str) ;
			Cut_string(debug_string[4]);
			
			//AVMem_free(headinfo);  			

			dir_hwnd->draw_info[4].draw_data = (INT32U)debug_string[3];
			dir_hwnd->draw_info[5].draw_data = (INT32U)debug_string[4];
		}
		else close(fd);
	}
	/*******************************************************
						MP3 file info
	*******************************************************/
		if((strncmp(file_info_onshow.file_type,"MP3",3) == 0)){

		ID3_Tag ID3;
		int size;
			
			GetID3(g_item_name, &ID3, &size);

			GetMusicInfoStr(TITLE_STR, ID3.title, 3,dir_hwnd);
			GetMusicInfoStr(ARTIST_STR,ID3.artist,4,dir_hwnd);
			GetMusicInfoStr(ALBUM_STR, ID3.album, 5,dir_hwnd);
			GetMusicInfoStr(GENRE_STR, ID3.genre, 6,dir_hwnd);

			//AVMem_free(ID3);
		
		}
     /*******************************************************
						Video file info
        *******************************************************/	
	
		if(have_videoinfo_flag){											//have_videoinfo_flag
			
			GetVideoInfoStr(VEDIO_TYPE_STR,video_inf.video_type,2,dir_hwnd);	
			GetVideoInfoStr(AUDIO_TYPE_STR,video_inf.audio_type,3,dir_hwnd);	
			GetVideoInfoStr(MOVIE_DUR_STR ,video_inf.total_time,4,dir_hwnd);	
					
			have_videoinfo_flag = 0;
		}
	
	/*******************************************************
						PIC file info
	*******************************************************/	
		
		
		if((strncmp(file_info_onshow.file_type,"JPEG",7) == 0)){
			
			
			GetPicInfo_From_Filelist();
		} 
		else
	        AWPostMessage(dir_hwnd, WM_PAINT, 0) ;
		}
}

static void FileListPreviewCheck(PHWND hwnd)
{
    INT32U file_type ;
    TFILELIST *pList = (TFILELIST *)hwnd ;
    INT8U index,item_num = AWGetTFilelistItemNum(pList) ;
    for(index =0; index < item_num; index++){
        file_type = (INT32U)pList->filelist_items[index].filelist_item_context ;
            if(pList->focused_item_index == index){
                if(file_type & NAV_IS_DIR){
                    pList->filelist_items[index].filelist_item_bmp = (INT32U)ICON_FILE_FILE_TYPE_FOCUS ;//(INT32U)Folder1 ;
                }
                else if(file_type & AW_AUDIO_LIST)
		      pList->filelist_items[index].filelist_item_bmp = (INT32U)ICON_FILE_MUSIC_TYPE_FOCUS ;//(INT32U)Song1 ;	                    
                else if(file_type & MEDIA_PIC)
                    pList->filelist_items[index].filelist_item_bmp = (INT32U)ICON_FILE_PHOTO_TYPE_FOCUS ;//(INT32U)Pictur1 ;
                else if(file_type & AW_VIDEO_LIST)
                    pList->filelist_items[index].filelist_item_bmp = (INT32U)ICON_FILE_MOVIE_TYPE_FOCUS ;//(INT32U)Mpeg1 ;
                else
                    pList->filelist_items[index].filelist_item_bmp = (INT32U)ICON_UNKNOW_FOCUS ;
            }
            else{
                
                if(file_type & NAV_IS_DIR){
                    pList->filelist_items[index].filelist_item_bmp = (INT32U)ICON_FILE_FILE_TYPE_LOSE ;//(INT32U)Folder0 ;
                }
                else if(file_type & AW_AUDIO_LIST)
                    pList->filelist_items[index].filelist_item_bmp = (INT32U)ICON_FILE_MUSIC_TYPE_LOSE ;//(INT32U)Song0 ;
                else if(file_type & MEDIA_PIC)
                    pList->filelist_items[index].filelist_item_bmp = (INT32U)ICON_FILE_PHOTO_TYPE_LOSE ;//(INT32U)Pictur0 ;
                else if(file_type & AW_VIDEO_LIST)
                    pList->filelist_items[index].filelist_item_bmp = (INT32U)ICON_FILE_MOVIE_TYPE_LOSE ;//(INT32U)Mpeg0 ;
                else
                    pList->filelist_items[index].filelist_item_bmp = (INT32U)ICON_UNKNOW_LOSE;
            }
    }
}

INT32S WinFileListOnShow(PHWND hwnd, INT32S lpParam)
{
	PHWND dir_hwnd ;
	ucUseUsbFlag = 0 ;
	filelist_show_flag = 1;
//	disable_video_layer();
	String_roll_state_file == UNROLL ;
	roll_string_timeout = 0 ;
	reset_file_node();
	switch(CurrentOsdSize){
		default:
	case STANDARD:
		Filelist_Bar_Str_len = 160 ;
		osdsettpval(0,0xf);
		break;
		
#ifdef TV_MODE_1080P
	case OsdSize1080p:
		Filelist_Bar_Str_len = 330 ;
		osdsettpval(0,0xf);
		break;		
#endif

#ifdef TV_MODE_720P	
	case OsdSize720p:
		Filelist_Bar_Str_len = 330 ;
		osdsettpval(0,0xf);
		break;		
#endif
	}
	dir_hwnd = AWFindWinCtrlByName(FileListPreview) ;
	if(dir_hwnd == NULL)
		return 0;
	AWShowWinControl(dir_hwnd, 0) ;

	TFILELIST *pList = (TFILELIST *)AWFindWinCtrlByName(FileListPreview);
	AWSetFocus(dir_hwnd) ;
	
	return 0 ;

}


void FLUpdateUpgradeControl(char upgrade_state_flag)
{
	upgrade_flag=1 ;
	PHWND hwnd = AWFindWinCtrlByName(WinFileListUpgrade) ;
	if(hwnd){

		if(upgrade_showctrl_flag == 0){
			  
			AWShowWinControl(hwnd, 0);
			AWSetFocus(hwnd);
	        upgrade_showctrl_flag = 1;
		}
		switch(upgrade_state_flag){
			case 0:   //normal info
				hwnd->draw_info[7].draw_data = (INT32U)ICON_UPGRADE_PERCENT_INFOBAR;//ICON_UPGRADE_PERCENT_INFOBAR_BGD;			
				AWPostMessage(hwnd, WM_PAINT_DRAW_INFO, 7) ;
				hwnd->draw_info[6].draw_data = (INT32U)ICON_UPGRADE_BLANK;
				hwnd->draw_info[3].draw_data = (INT32U)0;//UpgradeInfo
            #ifdef TV_MODE_1080P	
				if(CurrentOsdSize == OsdSize1080p)
					hwnd->draw_info[3].draw_pos_x = 815;
				else 
			#endif
            #ifdef TV_MODE_720P	
				if(CurrentOsdSize == OsdSize720p)
					hwnd->draw_info[3].draw_pos_x = 815;
				else 
            #endif
					hwnd->draw_info[3].draw_pos_x = 394;
				if((CurrentOsdSize == OsdSize480i)||(CurrentOsdSize == OsdSize480p) ||(CurrentOsdSize == OsdSize480iCVBS))
					hwnd->draw_info[3].draw_pos_y = 214;
            #ifdef TV_MODE_1080P	
				else if(CurrentOsdSize == OsdSize1080p)
					hwnd->draw_info[3].draw_pos_y = 418;
			#endif
            #ifdef TV_MODE_720P	
				else if(CurrentOsdSize == OsdSize720p)
					hwnd->draw_info[3].draw_pos_y = 418;
            #endif
            #ifdef SUPPORT_VGA		
				else if(CurrentOsdSize == OsdSizeVga)
					hwnd->draw_info[3].draw_pos_y = 214;
            #endif
                else 
					hwnd->draw_info[3].draw_pos_y = 262;
				AWPostMessage(hwnd, WM_PAINT_DRAW_INFO, 6) ;
				AWPostMessage(hwnd, WM_PAINT_DRAW_INFO, 3) ;	
				AWPostMessage(hwnd, WM_PAINT_FINISH, 0) ;
			break;
			case 1:   //percent
				hwnd->draw_info[7].draw_data = (INT32U)ICON_UPGRADE_PERCENT_INFOBAR;			
				AWPostMessage(hwnd, WM_PAINT_DRAW_INFO, 7) ;
				
				hwnd->draw_info[6].draw_data = (INT32U)ICON_UPGRADE_BLANK;
				hwnd->draw_info[3].draw_data = (INT32U)UpgradeInfo;
            #ifdef TV_MODE_1080P	
				if(CurrentOsdSize == OsdSize1080p)
					hwnd->draw_info[3].draw_pos_x = 880;
				else 
			#endif
            #ifdef TV_MODE_720P	
				if(CurrentOsdSize == OsdSize720p)
					hwnd->draw_info[3].draw_pos_x = 880;
				else 
            #endif
					hwnd->draw_info[3].draw_pos_x = 483;
				if((CurrentOsdSize == OsdSize480i)||(CurrentOsdSize == OsdSize480p) ||(CurrentOsdSize == OsdSize480iCVBS))
					hwnd->draw_info[3].draw_pos_y = 280;
            #ifdef TV_MODE_1080P	
				else if(CurrentOsdSize == OsdSize1080p)
					hwnd->draw_info[3].draw_pos_y = 418;
			#endif
            #ifdef TV_MODE_720P	
				else if(CurrentOsdSize == OsdSize720p)
					hwnd->draw_info[3].draw_pos_y = 418;
            #endif
            #ifdef SUPPORT_VGA		
				else if(CurrentOsdSize == OsdSizeVga)
					hwnd->draw_info[3].draw_pos_y = 280;
            #endif
				else
					hwnd->draw_info[3].draw_pos_y = 328;
					
				AWPostMessage(hwnd, WM_PAINT_DRAW_INFO, 6) ;
				AWPostMessage(hwnd, WM_PAINT_DRAW_INFO, 3) ;
									
				AWPostMessage(hwnd, WM_PAINT_FINISH, 0) ;
			break;
			case 2:    //finish
				hwnd->draw_info[7].draw_data = (INT32U)ICON_UPGRADE_PERCENT_INFOBAR;			
				AWPostMessage(hwnd, WM_PAINT_DRAW_INFO, 7) ;
				
				//hwnd->draw_info[6].draw_data = (INT32U)ICON_UPGRADE_BLANK;
				hwnd->draw_info[3].draw_data = (INT32U)UpgradeInfo;
            #ifdef TV_MODE_1080P	
				if(CurrentOsdSize == OsdSize1080p)
					hwnd->draw_info[3].draw_pos_x = 865;
				else 
			#endif
            #ifdef TV_MODE_720P	
				if(CurrentOsdSize == OsdSize720p)
					hwnd->draw_info[3].draw_pos_x = 865;
				else 
            #endif
					hwnd->draw_info[3].draw_pos_x = 467;
				if((CurrentOsdSize == OsdSize480i)||(CurrentOsdSize == OsdSize480p) ||(CurrentOsdSize == OsdSize480iCVBS))
					hwnd->draw_info[3].draw_pos_y = 280;
            #ifdef TV_MODE_1080P	
				else if(CurrentOsdSize == OsdSize1080p)
					hwnd->draw_info[3].draw_pos_y = 418;
			#endif
            #ifdef TV_MODE_720P	
				else if(CurrentOsdSize == OsdSize720p)
					hwnd->draw_info[3].draw_pos_y = 418;
            #endif
            #ifdef SUPPORT_VGA		
				else if(CurrentOsdSize == OsdSizeVga)
					hwnd->draw_info[3].draw_pos_y = 280;
            #endif
				else
					hwnd->draw_info[3].draw_pos_y = 328;
				
				//AWPostMessage(hwnd, WM_PAINT_DRAW_INFO, 6) ;			
				AWPostMessage(hwnd, WM_PAINT_DRAW_INFO, 3) ;
									
				AWPostMessage(hwnd, WM_PAINT_FINISH, 0) ;
			break;
			case 3:    //erasing
				hwnd->draw_info[7].draw_data = (INT32U)ICON_UPGRADE_PERCENT_INFOBAR;			
				AWPostMessage(hwnd, WM_PAINT_DRAW_INFO, 7) ;
				
				hwnd->draw_info[6].draw_data = (INT32U)ICON_UPGRADE_BLANK;
				hwnd->draw_info[3].draw_data = (INT32U)UpgradeInfo;
            #ifdef TV_MODE_1080P	
				if(CurrentOsdSize == OsdSize1080p)
					hwnd->draw_info[3].draw_pos_x = 865;
				else 
			#endif
            #ifdef TV_MODE_720P	
				if(CurrentOsdSize == OsdSize720p)
					hwnd->draw_info[3].draw_pos_x = 865;
				else 
            #endif
					hwnd->draw_info[3].draw_pos_x = 394;
				if((CurrentOsdSize == OsdSize480i)||(CurrentOsdSize == OsdSize480p) ||(CurrentOsdSize == OsdSize480iCVBS))
					hwnd->draw_info[3].draw_pos_y = 214;
            #ifdef TV_MODE_1080P	
				else if(CurrentOsdSize == OsdSize1080p)
					hwnd->draw_info[3].draw_pos_y = 418;
			#endif
            #ifdef TV_MODE_720P	
				else if(CurrentOsdSize == OsdSize720p)
					hwnd->draw_info[3].draw_pos_y = 418;
            #endif
            #ifdef SUPPORT_VGA		
				else if(CurrentOsdSize == OsdSizeVga)
					hwnd->draw_info[3].draw_pos_y = 214;
            #endif
				else
					hwnd->draw_info[3].draw_pos_y = 262;
				
				AWPostMessage(hwnd, WM_PAINT_DRAW_INFO, 6) ;
				AWPostMessage(hwnd, WM_PAINT_DRAW_INFO, 3) ;
									
				AWPostMessage(hwnd, WM_PAINT_FINISH, 0) ;
			break;
			case 4:    //reading
				hwnd->draw_info[7].draw_data = (INT32U)ICON_UPGRADE_PERCENT_INFOBAR;			
				AWPostMessage(hwnd, WM_PAINT_DRAW_INFO, 7) ;
				
				hwnd->draw_info[6].draw_data = (INT32U)ICON_UPGRADE_BLANK;
				hwnd->draw_info[3].draw_data = (INT32U)UpgradeInfo;
            #ifdef TV_MODE_1080P	
				if(CurrentOsdSize == OsdSize1080p)
					hwnd->draw_info[3].draw_pos_x = 865;
				else 
			#endif
            #ifdef TV_MODE_720P	
				if(CurrentOsdSize == OsdSize720p)
					hwnd->draw_info[3].draw_pos_x = 865;
				else 
            #endif
					hwnd->draw_info[3].draw_pos_x = 465;
				if((CurrentOsdSize == OsdSize480i)||(CurrentOsdSize == OsdSize480p) ||(CurrentOsdSize == OsdSize480iCVBS))
					hwnd->draw_info[3].draw_pos_y = 280;
            #ifdef TV_MODE_1080P	
				else if(CurrentOsdSize == OsdSize1080p)
					hwnd->draw_info[3].draw_pos_y = 418;
			#endif
            #ifdef TV_MODE_720P	
				else if(CurrentOsdSize == OsdSize720p)
					hwnd->draw_info[3].draw_pos_y = 418;
            #endif
            #ifdef SUPPORT_VGA		
				else if(CurrentOsdSize == OsdSizeVga)
					hwnd->draw_info[3].draw_pos_y = 280;
            #endif
				else
					hwnd->draw_info[3].draw_pos_y = 328;					
				
				AWPostMessage(hwnd, WM_PAINT_DRAW_INFO, 6) ;			
				AWPostMessage(hwnd, WM_PAINT_DRAW_INFO, 3) ;
									
				AWPostMessage(hwnd, WM_PAINT_FINISH, 0) ;
			break;
			default:
			break;
		}

	}
	
}

INT32S WinFileListUpgradeOnShow(PHWND hwnd, INT32S lpParam)
{
	if(upgrade_platformID != 455555){		
		hwnd->draw_info[3].draw_data = (INT32U)UpgradeInfo;
		
	}	
	return 0 ;
}

INT32S WinFileListUpgradeOnPaint(PHWND hwnd, INT32S lpParam)
{
    return 0;
}

char upgrade_high_light=1;
char upgrade_stopkey_flag=0;

INT32S WinFileListUpgradeOnKeyPress(PHWND hwnd, INT32S lpParam)
{
    
    INT32U *key_value = (INT32U *)lpParam ;
    if(upgrade_stopkey_flag == 1){
		ClearPanelAction(key_value);
		return 0 ;
    }
	
	switch(*key_value){
        case UOP_LEFT:
 	 case UOP_RIGHT:
			if ((*key_value) == UOP_LEFT)
			{
				upgrade_high_light--;
			}
			else upgrade_high_light++;
			
			if(upgrade_high_light == 0xff)
				upgrade_high_light = 1;
					
			if(upgrade_high_light > 1)
				upgrade_high_light = 0;
			
			if(upgrade_high_light == 0)
			{
				hwnd->draw_info[4].draw_data = (INT32U)ICON_YES_FOCUS;
				hwnd->draw_info[5].draw_data = (INT32U)ICON_NO_LOSE;				
			}
			else
			{
				hwnd->draw_info[4].draw_data = (INT32U)ICON_YES_LOSE;
				hwnd->draw_info[5].draw_data = (INT32U)ICON_NO_FOCUS;
			}
			
		    AWPostMessage(hwnd, WM_PAINT_DRAW_INFO, 4) ;
		    AWPostMessage(hwnd, WM_PAINT_DRAW_INFO, 5) ;
		    AWPostMessage(hwnd, WM_PAINT_FINISH, 0) ;
			
				
		break;
		case UOP_ENTER:
			if(upgrade_high_light == 0)
			{
				upgrade_showctrl_flag = 0;
	#ifdef ENABLE_NETWORK
			         Set_WiFi_Status(0);
	#endif
				
				if(455555 == upgrade_platformID)
					upgrade_stopkey_flag = 1;
				#ifdef ENABLE_NANDDRV
					PlayTxtFile_nand(g_item_name, TXT_PLAY_IMG , UPGRADE_OPEN_INTERRUPT, 0) ;//UPGRADE_OPEN_INTERRUPT
				#else
					PlayTxtFile(g_item_name, TXT_PLAY_IMG , UPGRADE_OPEN_INTERRUPT, 0) ;
				#endif
			}
			else 
			{
				upgrade_showctrl_flag = 0;
				hwnd->draw_info[7].draw_data = 0;
				AWHideWinControl(hwnd);
				AWShowWinControl(AWFindWinCtrlByName(WinFileInfoBKG),0); 
				AWSetFocus(AWFindWinCtrlByName(FileListPreview));	
			}
		break;
			default:
		break;
	}
	return 0 ;
}

INT32S WinFileListBKGOnShow(PHWND hwnd, INT32S lpParam)
{ 
  if(WinTypeChoice == TXT)
   hwnd->draw_info[1].draw_data=(INT32U)ICON_TXT_TOP;
  else
   hwnd->draw_info[1].draw_data=(INT32U)ICON_FILE_TOP;

	return 0;
}

INT32S WinFileListBKGOnPaint(PHWND hwnd, INT32S lpParam)
{
    char *dir_path;
    char dbg_path[256];
    INT8U offset1=0,offset2=0;
	if((CurrentOsdSize == OsdSize480i)||(CurrentOsdSize == OsdSize480p) ||(CurrentOsdSize == OsdSize480iCVBS))
	{
		offset1 = 0 ;
		offset2 = 0 ;
	}
	else if((CurrentOsdSize==OsdSize576i)||(CurrentOsdSize==OsdSize576p) ||(CurrentOsdSize == OsdSize576iCVBS))
	{
		offset1 = 48 ;
		offset2 = 0 ;
	}
#ifdef TV_MODE_1080P	
	else if(CurrentOsdSize==OsdSize1080p)
	{
		offset1 = 56 ;
		offset2 = 60 ;
	}
#endif
#ifdef TV_MODE_720P	
	else if(CurrentOsdSize==OsdSize720p)
	{
		offset1 = 56 ;
		offset2 = 60 ;
	}
#endif
		hwnd->pClass->ClassProc(hwnd, WM_PAINT, 0);
		dir_path = FileNavGetCurrDir();
		FormatFileName_StringCat(dbg_path, dir_path, sizeof(dbg_path));
		memset(PATH_STR,0,sizeof(PATH_STR));
		snprintf(PATH_STR,sizeof(PATH_STR),"%s",dbg_path);
		hwnd->draw_info[4].draw_data = (INT32U)ICON_PATH_BLANK;
		hwnd->pClass->ClassProc(hwnd, WM_PAINT_DRAW_INFO, 4);
		hwnd->pClass->ClassProc(hwnd, WM_PAINT_FINISH, 0);
		hwnd->draw_info[5].draw_data = (INT32U)0 ;
		hwnd->draw_info[5].draw_type = DT_VOSD_DATA ;
		vosd_selfroll_string(hwnd, 
							 5,
							 PATH_STR, 
							 82+offset2, 
							 108+offset1, 
							 &caption_moving_timer_2, 
							 caption_moving_time_func_2, 
							 hwnd->draw_info[5].draw_width,
							 MOVING_VOSD_LEFT_ROLL, //0
							 UNROLL
							 );

    return 1 ;
}

INT32S WinFileInfoBKGOnShow(PHWND hwnd, INT32S lpParam)
{
    return 0 ;
}

INT32S WinFileInfoBKGOnPaint(PHWND hwnd, INT32S lpParam)
{
    return 0 ;
}

INT32S WinFileInfoBKGOnHide(PHWND hwnd, INT32S lpParam)
{
    return 0 ;
}
INT32S WinFileMusicBKGOnShow(PHWND hwnd, INT32S lpParam)
{
    return 0 ;
}
INT32S WinFileMusicBKGOnPaint(PHWND hwnd, INT32S lpParam)
{
    return 0 ;
}
INT32S WinFileMusicBKGOnKeyPress(PHWND hwnd, INT32S lpParam)
{
    return 0 ;
}
INT32S WinFileSpectrumOnShow(PHWND hwnd, INT32S lpParam)
{
    return 0 ;
}

void FilePathInfo()
{
	PHWND dir_hwnd;
	char dbg_path[256];
	char *dir_path ;
	
	INT8U offset1=0,offset2=0;
	if((CurrentOsdSize == OsdSize480i)||(CurrentOsdSize == OsdSize480p) ||(CurrentOsdSize == OsdSize480iCVBS))
	{
		offset1 = 0 ;
		offset2 = 0 ;
	}
	else if((CurrentOsdSize==OsdSize576i)||(CurrentOsdSize==OsdSize576p) ||(CurrentOsdSize == OsdSize576iCVBS))
	{
		offset1 = 48 ;
		offset2 = 0 ;
	}
#ifdef TV_MODE_1080P	
	else if(CurrentOsdSize==OsdSize1080p)
	{
		offset1 = 56 ;
		offset2 = 60 ;
	}
#endif
#ifdef TV_MODE_720P	
	else if(CurrentOsdSize==OsdSize720p)
	{
		offset1 = 56 ;
		offset2 = 60 ;
	}
#endif
		dir_hwnd = AWFindWinCtrlByName(WinFileListBKG) ;
		if(dir_hwnd)
		{
			dir_path = FileNavGetCurrDir();
			FormatFileName_StringCat(dbg_path, dir_path, sizeof(dbg_path));
			memset(PATH_STR,0,sizeof(PATH_STR));
			snprintf(PATH_STR,sizeof(PATH_STR),"%s",dbg_path);
			dir_hwnd->draw_info[4].draw_data = (INT32U)ICON_PATH_BLANK;
			dir_hwnd->pClass->ClassProc(dir_hwnd, WM_PAINT_DRAW_INFO, 4);
			dir_hwnd->pClass->ClassProc(dir_hwnd, WM_PAINT_FINISH, 0);
//			dir_hwnd->draw_info[5].draw_data = (INT32U)0 ;
//			dir_hwnd->draw_info[5].draw_type = DT_VOSD_DATA ;
			vosd_selfroll_string(dir_hwnd, 
								 5,
								 PATH_STR, 
								 82+offset2, 
								 108+offset1, 
								 &caption_moving_timer_2, 
								 caption_moving_time_func_2, 
								 dir_hwnd->draw_info[5].draw_width,
								 MOVING_VOSD_LEFT_ROLL, //0
								 UNROLL
								 );
		}
}

void DelTimer()
{
		if(caption_moving_timer_1)
		{
			AVTimerDelete(caption_moving_timer_1);
			caption_moving_timer_1 = 0;
		}
		if(caption_moving_timer_2)
		{
			AVTimerDelete(caption_moving_timer_2);
			caption_moving_timer_2 = 0;
		}
		if(caption_moving_timer_3)
		{
			AVTimerDelete(caption_moving_timer_3);
			caption_moving_timer_3 = 0;
		}
}

INT32S FileListPreviewOnShow(PHWND hwnd, INT32S lpParam)
{
    TFILELIST *pList = (TFILELIST *)hwnd ;
    INT8U my_app_id ;
    char *item_name;
    INT32U file_index ;
    INT32U item_type ;
    
    AWGetAppID(MEDIA_GENERAL, &my_app_id) ; 
    if (FileListOnShowFlag == 0) 
    {
        FileListOnShowFlag = 1 ;
	 memset(debug_string, 0, sizeof(debug_string));
        pList->focused_item_index = 0 ;
        pList->first_item_index = 0 ;
        pList->list_levels = 0 ;
        pList->filelist_status &= ~T_FILELIST_DISVISABLE ;
        pList->filelist_status &= ~T_FILELIST_SHOW_UP_ARROW ;
        if(ucCopyFileFlag) 
	 {
            pList->filelist_status |= T_FILELIST_HAVE_SELECT_ITEM ;
        }
        else 
	 {
            pList->filelist_status &= ~T_FILELIST_HAVE_SELECT_ITEM ;
        }
        pList->cd_root_entry(pList->total_items, pList->filelist_items) ;

        if(pList->get_next_entrys(0, pList->total_items, pList->filelist_items))
            pList->filelist_status |= T_FILELIST_SHOW_DOWN_ARROW ;
        else
            pList->filelist_status &= ~T_FILELIST_SHOW_DOWN_ARROW ;
    }   
	FileListPreviewCheck(hwnd) ;
    
	hwnd = hwnd->children ;
	while(hwnd) //forward this show message to all children
	{
		if(!(hwnd->style & WS_DISVISIBLE))
			AWSendMessage(hwnd, WM_SHOWWINDOW, lpParam);
			hwnd = hwnd->siblings ;
	}
		file_index = pList->filelist_items[pList->focused_item_index].filelist_item_id ;
   		CurrentIndex = pList->filelist_items[pList->first_item_index].filelist_item_id ;
		item_name = GetFullName(file_index, &item_type) ;
		Get_FileInfo(item_name);
		g_item_name = item_name;
		item_type = GetMediaType(item_name);
		ShowFileInfor();
    return 1 ;    
}

INT32S FileListPreviewOnKeyPress(PHWND hwnd, INT32S lpParam)
{
	PHWND dir_hwnd ;
	TFILELIST *pList = (TFILELIST *)hwnd ;
	INT32U *key_value = (INT32U *)lpParam ;
	char *item_name, *text,extname[5];
	INT32U file_index ;
	INT32U item_type ;
	INT32U app_type ;
	int i=1;
	INT8U my_app_id ;
#ifdef KOREAR_REMOTE
	INT8U my_app_id;
	AWGetAppID(MEDIA_GENERAL, &my_app_id) ; 
    	if (AWGetAppStatus(my_app_id) == APP_RUNNING) //if is playing(movie or music),the left key and the right key will act as fast backword/forward
	{
		switch(*key_value)
		{
			case UOP_LEFT:
				*key_value = UOP_FAST_BACKWARD;
				break;
			case UOP_RIGHT:
				*key_value = UOP_FAST_FORWARD;
				break;
				
		}
	}
#endif	
    switch(*key_value){
		case UOP_HOME:
		 	*key_value = UOP_STOP;
			DelTimer();
			GUIHideWindow(WinFileList);
			FileNavCD(CurDriver);
			GUIShowWindow(WinDeviceSelect);
			break;
			
	 	case UOP_RESUME:
		 	*key_value = UOP_STOP;
			DelTimer();
			GUIHideWindow(WinFileList);
	#ifdef ENABLE_NETWORK 		
			if (IsNetWorkDev())
				GUIShowWindow("WinDeviceSelect");
			else
	#endif	 	
		 	GUIShowWindow(WinFileTypeSelect);
			break; 
				
        case UOP_LEFT:
			if(pList->list_levels==0)
				break;

			if(pList->list_levels == 1){
				hwnd->pClass->ClassProc(hwnd, WM_KEYDOWN, lpParam) ;//call original fun first
 				if(CheckMediaPlaybackApp()){
					*key_value = UOP_STOP; 
				}
				AVTimerDelete(caption_moving_timer_3);
		  		FileListPreviewCheck(hwnd) ;
				file_index = pList->filelist_items[pList->focused_item_index].filelist_item_id ;
				item_name = GetFullName(file_index, &item_type) ;
				g_item_name = item_name;
				Get_FileInfo(item_name);
				item_type = GetMediaType(item_name);
				ShowFileInfor();
				AWPostMessage(hwnd, WM_PAINT, 0) ;
				FilePathInfo();
                return 1 ;
            }
            
			hwnd->pClass->ClassProc(hwnd, WM_KEYDOWN, lpParam) ;//call original fun first
			if(CheckMediaPlaybackApp()){
				*key_value = UOP_STOP; 
			}
			AVTimerDelete(caption_moving_timer_3);
			FileListPreviewCheck(hwnd) ;
			file_index = pList->filelist_items[pList->focused_item_index].filelist_item_id ;
			item_name = GetFullName(file_index, &item_type) ;
			g_item_name = item_name;
			Get_FileInfo(item_name);
			item_type = GetMediaType(item_name);
			ShowFileInfor();
			AWPostMessage(hwnd, WM_PAINT_HELP_INFO, 0) ;
			FilePathInfo();  	
            return 1 ;
            
        case UOP_RIGHT:
        #ifdef TXT_PLAYER
            if(WinTypeChoice == TXT)
                break;
        #endif
            if(CheckMediaPlaybackApp())
                break;
            if(!((pList->filelist_items[pList->focused_item_index].filelist_item_status & (ITEM_IS_DIRECTORY))==(ITEM_IS_DIRECTORY)))
            {
#if (defined ENABLE_NETWORK)&&(!(defined ENABLE_NETWORK_UPLOAD_DOWNLOAD))
				if(IsNetWorkDev())         
				{
					*key_value = UOP_NOP;
					return 1;
				}
#endif

                file_index = pList->filelist_items[pList->focused_item_index].filelist_item_id ;
                item_name = GetFullName(file_index, &item_type) ;
                if(!AWCheckPlayListItemExist(item_name, MEDIA_GENERAL, file_index)) 
		  		{		
                    AWRemovePlaylistItem(item_name, MEDIA_GENERAL, (INT16U)file_index) ;
                }
                else 
		  		{		
                    AWAddPlaylistItem(item_name, MEDIA_GENERAL, (INT16U)file_index) ;
                }
                pList->filelist_status |= T_FILELIST_PAINT_ITEM ;
                pList->filelist_items[pList->focused_item_index].filelist_item_status |= ITEM_UPDATE ;
                AWPostMessage(hwnd, WM_PAINT, 0) ;
                return 1;
            }
            else if(!((pList->filelist_items[pList->focused_item_index].filelist_item_status & (ITEM_HAVE_DATA))==(ITEM_HAVE_DATA)))    //Empty
                return 1;
ENTER_NEW_DIR:
            hwnd->pClass->ClassProc(hwnd, WM_KEYDOWN, lpParam) ;//call original fun first
            FileListPreviewCheck(hwnd) ;
			file_index = pList->filelist_items[pList->focused_item_index].filelist_item_id ;
			item_name = GetFullName(file_index, &item_type) ;
			g_item_name=item_name;
			Get_FileInfo(item_name);
			item_type = GetMediaType(item_name);
			ShowFileInfor();
			AWPostMessage(hwnd, WM_PAINT_HELP_INFO, 0) ;
            if(pList->list_levels > 0)
	     	{	
                FilePathInfo();
            }
            return 1 ;
            
        case UOP_PREVIOUS_CHAP:
        case UOP_NEXT_CHAP:
          	if(CheckMediaPlaybackApp())
          		break;
          		
			if(upgrade_flag)
                break;
#ifdef ENABLE_NETWORK
       if(IsNetWorkDev())
       	{
			if(CheckMediaPlaybackApp()&&(!IsNetWorkDev()))
			{
				*key_value =UOP_NOP;
				break;
			}
			// first stop the gplayer
			AWGetAppID(MEDIA_GENERAL, &my_app_id) ;
			if ((AWGetAppStatus(my_app_id) == APP_RUNNING))
			{
				AWGPlayerKeyDo(UOP_STOP);
			}else{
				*key_value =UOP_NOP;
				break;			    
			}
			 				
			if(*key_value ==UOP_PREVIOUS_CHAP)
				*key_value = UOP_UP;//UOP_PAGE_UP;
			else
				*key_value = UOP_DOWN;//UOP_PAGE_DOWN;
			playnextflg = 1;
			notshowinfo = 1;			
//			pList->focused_item_index =	pList->focused_item_index+1;
            if(pList->focused_item_index == gCurrentDirMusicNum-1)
            {             
                *key_value =UOP_STOP;
                playnextflg = 0;
	            PHWND hwnd = AWFindWinCtrlByName("WinFileListProcessBar");
	            if(hwnd)
	                AWHideWinControl(hwnd);                
				file_index = pList->filelist_items[pList->focused_item_index].filelist_item_id ;
				item_name = GetFullName(file_index, &item_type) ;
				Get_FileInfo(item_name);
				item_type = GetMediaType(item_name);
				ShowFileInfor();                
                break;    
            }    			
			hwnd->pClass->ClassProc(hwnd, WM_KEYDOWN,(INT32S)&(*key_value)) ;//call original fun first
		    FileListPreviewCheck(hwnd) ;
		    break;
       	}
        else
        	{
            if(CheckMediaPlaybackApp())
				{
				*key_value =UOP_NOP;
				break;
				}
			if(*key_value ==UOP_PREVIOUS_CHAP)
				*key_value = UOP_PAGE_UP;
			else
				*key_value = UOP_PAGE_DOWN;
			hwnd->pClass->ClassProc(hwnd, WM_KEYDOWN, lpParam) ;//call original fun first
        	}

#else
			if(CheckMediaPlaybackApp())
				{
				*key_value =UOP_NOP;
				break;
				}
			if(*key_value ==UOP_PREVIOUS_CHAP)
				*key_value = UOP_PAGE_UP;
			else
				*key_value = UOP_PAGE_DOWN;
			hwnd->pClass->ClassProc(hwnd, WM_KEYDOWN, lpParam) ;//call original fun first

#endif

            if(*key_value ==UOP_PREVIOUS_CHAP)
                *key_value = UOP_PAGE_UP;
            else
                *key_value = UOP_PAGE_DOWN;
			hwnd->pClass->ClassProc(hwnd, WM_KEYDOWN, lpParam) ;//call original fun first
        case UOP_DOWN:   
        case UOP_UP:    
          	if(CheckMediaPlaybackApp())
          		break;
          	else
		   	{		
				hwnd->pClass->ClassProc(hwnd, WM_KEYDOWN, lpParam) ;//call original fun first
				FileListPreviewCheck(hwnd) ;
    			CurrentIndex = pList->filelist_items[pList->first_item_index].filelist_item_id ;
				file_index = pList->filelist_items[pList->focused_item_index].filelist_item_id ;
				item_name = GetFullName(file_index, &item_type) ;
				g_item_name=item_name;
				Get_FileInfo(item_name);
				item_type = GetMediaType(item_name);
				ShowFileInfor();
				AWPostMessage(hwnd, WM_PAINT_HELP_INFO, 0) ;   
          	}    
            return 1 ;
            
        case UOP_ENTER:
    		INT16U filelist_item_id;
    		INT8U DO_UOP_ENTER=1;        		 
			JpegPlayStatus=0;
			FileMenuToSingle=1;				 
            if((pList->filelist_items[pList->focused_item_index].filelist_item_status & (ITEM_HAVE_DATA))!=(ITEM_HAVE_DATA))
		    { //no data
               return 1;
            }
            if((pList->filelist_items[pList->focused_item_index].filelist_item_status & (ITEM_IS_DIRECTORY))==(ITEM_IS_DIRECTORY))
	     	{ //is dir
                goto ENTER_NEW_DIR ;
            }else{
        		char* pic_item_name;
        		INT32U pic_item_type;
        		pic_item_name = pList->get_entry_full_name(pList->filelist_items[pList->focused_item_index].filelist_item_id, &pic_item_type) ;
        		pic_item_type = GetMediaType(pic_item_name) ;
        		if(pic_item_type & MEDIA_PIC)
				goto END_PAUSE_CASE;
            }
            
		case UOP_END_PAUSE:
        	FileMenuToSingle = 2;	
END_PAUSE_CASE:        	
	     	if((pList->filelist_items[pList->focused_item_index].filelist_item_status & (ITEM_IS_DIRECTORY))==(ITEM_IS_DIRECTORY))
                break;
		 
		  	AWClearPlaylist(MEDIA_GENERAL) ;
            *key_value = UOP_NOP;   
            item_name = pList->get_entry_full_name(pList->filelist_items[pList->focused_item_index].filelist_item_id, &item_type) ;
            if(!item_name)
                break;
			if(CheckMediaPlaybackApp())
			{
				if(AudioStatus == AUDIO_PLAY)
				{
					*key_value = UOP_PAUSE ;
					break;
				}
				else if (AudioStatus == AUDIO_PAUSE)
				{
					*key_value = UOP_END_PAUSE ;
					break;
				}
				else if (AudioStatus != AUDIO_STOP)
				{
					*key_value = UOP_END_PAUSE ;
					break;
				}
			}
            AWSetFileList(AWFindWinCtrlByName(FileListPreview), NULL, NULL);
            item_type = GetMediaType(item_name) ;
            if(item_type & AW_VIDEO_LIST){ //selected a AVI file, play it
			Playlist_t *playlist;

                file_index = pList->filelist_items[pList->focused_item_index].filelist_item_id ;
                playlist = fs_playlist_create(NULL,AW_VIDEO_LIST & NAV_PATH_TYPE ,
                                        PLAYLIST_TYPE_VIDEO,
                                        file_index,0,&app_type);
                if(playlist) {
#ifndef ATHENA_UNDER_DEVELOPING
                    if(item_type == MEDIA_MPEG1) {
                        if (RunVOBPlayer(playlist)) {
                            AWPlaylistDelete2(playlist);
                        }
                    }
                    else if(item_type == MEDIA_AVI){
                        if (RunAVIPlayer(playlist)) {
                            AWPlaylistDelete2(playlist);
                        }
                    }
#else
                    if(item_type == MEDIA_AVI){
                        if (RunAVIPlayer(playlist)) {
                            AWPlaylistDelete2(playlist);
                        }
                    }
#endif
                    if(item_type == MEDIA_MOV){
                        if (RunGPlayer(playlist)) {
                            AWPlaylistDelete2(playlist);
                        }
                    }
#ifdef SUPPORT_RM
                    else if(item_type == MEDIA_REAL){
                        if (RunRMPlayer(playlist)) {
                            AWPlaylistDelete2(playlist);
                        }
                    }
#endif                                     
                }

            }

           else if(item_type & AW_AUDIO_LIST){
                Playlist_t *Imageplaylist=NULL,*Audioplaylist=NULL;

                file_index = pList->filelist_items[pList->focused_item_index].filelist_item_id ;
                Audioplaylist = fs_playlist_create(NULL,(Music_Pic_mix_flag?AW_AUDIO_FOR_PICMIX_LIST:AW_AUDIO_LIST) & NAV_PATH_TYPE ,
                                        PLAYLIST_TYPE_AUDIO,
                                        file_index,0,&app_type);
		
			
start_play1:									
                if (Audioplaylist) {
                    if (RunGPlayer(Audioplaylist)) {
                        AWPlaylistDelete2(Audioplaylist);
                    }
		    AWPostMessage(hwnd, WM_PAINT, 0) ;
		    PHWND hwnd = AWFindWinCtrlByName(WinFileMusicBKG) ; 
		    if(hwnd)
			AWShowWinControl(hwnd, 0) ;
		    PHWND dir_hwnd = AWFindWinCtrlByName(WinFileSpectrum) ; 
		    if(dir_hwnd)
			AWShowWinControl(dir_hwnd, 0) ;
                } 
		if(Imageplaylist){
		         if(RunPICPlayer(Imageplaylist,(unsigned char *)Logo_keyboard, sizeof(Logo_keyboard), 0)){
		             AWPlaylistDelete2(Imageplaylist);
		                  }
		           }
		}
			
		else if(item_type & MEDIA_PIC){
                Playlist_t *Imageplaylist=NULL,*Audioplaylist=NULL;
                file_index = pList->filelist_items[pList->focused_item_index].filelist_item_id ;
                //AWClearPlaylist(MEDIA_PIC) ;
                strcpy(infobar_playmode, ":") ;
                //PrepareLocalPlayList(file_index, MEDIA_PIC) ;
                //item_name = AWGetFirstPlaylistItem(MEDIA_PIC) ;
                Imageplaylist = fs_playlist_create(NULL,MEDIA_PIC & NAV_PATH_TYPE ,PLAYLIST_TYPE_IMAGE, file_index,0,&app_type);

									if((((~gGetFileType)&AW_AUDIO_LIST)==0))
                	{    
                		filelist_item_id=GetFirstPlaylistIndex((Music_Pic_mix_flag?AW_AUDIO_FOR_PICMIX_LIST:AW_AUDIO_LIST) & NAV_PATH_TYPE );  
                		if(filelist_item_id==0xffff)
                			goto start_play ;          		 
                		 item_name = pList->get_entry_full_name(filelist_item_id, &item_type) ;
				            if(!item_name)
				                goto start_play;
					AWSetFileList(AWFindWinCtrlByName(FileListPreview), NULL, NULL);
					item_type = GetMediaType(item_name) ;
					if(item_type & AW_AUDIO_LIST){                
						file_index = filelist_item_id ;
			            
					Audioplaylist = fs_playlist_create(NULL,(Music_Pic_mix_flag?AW_AUDIO_FOR_PICMIX_LIST:AW_AUDIO_LIST) & NAV_PATH_TYPE ,
						PLAYLIST_TYPE_AUDIO,
						file_index ,0,&app_type);
			              			
		            		}
                	}

start_play:									
		GUIHideWindow(WinFileList);
		if(Imageplaylist){
			PicParaTrans();
			ShowSixPicFlag=0;
		if(RunPICPlayer(Imageplaylist,(unsigned char *)Logo_keyboard, sizeof(Logo_keyboard), 0)){
			AWPlaylistDelete2(Imageplaylist);
			}
		}
		if(DO_UOP_ENTER==1)
             		SetPicRunStatus(1);
          }
		else if(item_type & MEDIA_TXT){
			text = strrchr(item_name, '.') ;
                if(text) {
                	extname[0] = text[0];
                	extname[1] = text[1]&0xdf;
                	extname[2] = text[2]&0xdf;
                	extname[3] = text[3]&0xdf;
                	extname[4] = 0;
                    if(strncmp(extname,".IMG",4) == 0) {
#ifndef NO_FONT                    	
						extern void SetENFont(void);
						SetENFont();
#endif
					   
					   
					   snprintf(UPGRADEFILE_STR, sizeof(UPGRADEFILE_STR),"%s ",file_info_onshow.file_name) ;

					    
				       char *p_str,str_get[20];
					    INT16U StrLen; 
					   PHWND hwnd = AWFindWinCtrlByName(WinFileListUpgrade) ;
					   if(hwnd){
					   		p_str = (char *)AWGetResource(UPGRADE_MODEL_STR, &StrLen);
							strncpy(str_get, p_str, StrLen);
							str_get[StrLen] = 0 ; 
							sprintf(upgrade_model,"%s: %s",str_get,MODEL);
					        AWShowWinControl(hwnd, 0) ;
					   		AWSetFocus(hwnd);
					   }
							
			           return 0 ;
                    }
        #ifdef TXT_PLAYER
            if (strncmp(extname, ".TXT", 4) == 0)
            {
              if (CurrentOsdSize == OsdSize576i || CurrentOsdSize == OsdSize576p || CurrentOsdSize == OsdSize576iCVBS)
                PlayTxtFile(item_name, TXT_PLAY_TXT, TXT_DISPLAY_HIGH_IN_LINE, 640);
          #ifdef TV_MODE_1080P
              else if (CurrentOsdSize == OsdSize1080p)
                PlayTxtFile(item_name, TXT_PLAY_TXT, TXT_DISPLAY_HIGH_IN_LINE, 1160);
          #endif
          #ifdef TV_MODE_720P
              else if (CurrentOsdSize == OsdSize720p)
                PlayTxtFile(item_name, TXT_PLAY_TXT, TXT_DISPLAY_HIGH_IN_LINE, 1160);
          #endif
              else
                PlayTxtFile(item_name, TXT_PLAY_TXT, TXT_DISPLAY_HIGH_IN_LINE, 660);

              GUIHideWindow(WinFileList);
              GUIShowWindow(WinDebug);
            }
        #endif 
             }               
            }
            else {
            }
            break ;
            
        case UOP_OSD:
			if(CheckMediaPlaybackApp()){
          	   break; 
          	}
			else {
		    	if((ucCopyFileFlag)&&(AWGetFirstPlaylistItem(MEDIA_GENERAL)))
		        {
		        	dir_hwnd = AWFindWinCtrlByName(WinFileListCopyDelBKG) ;
		            if(dir_hwnd){
		            	if(dir_hwnd->style & WS_DISVISIBLE)
		                {
		                	SaveCurrentPath();  //Rex_Chen add
		                    for(i=1;i<25;i++){
		                    	dir_hwnd->draw_info[i].draw_data = (INT32U)0;
		                    }
		                    item_name = AWGetFirstPlaylistItem(MEDIA_GENERAL) ;
		                    if(item_name){
			                	dir_hwnd->style &= ~WS_DISVISIBLE;//AWShowWinControl(dir_hwnd, 0) ;
			                   	AWSetFocus(dir_hwnd) ;
								dir_hwnd->draw_info[0].draw_data = (INT32U)ICON_COPYDEL_BKG;
								dir_hwnd->draw_info[9].draw_data = (INT32U)ICON_COPYDEL_SMALL; 
								dir_hwnd->draw_info[1].draw_data = (INT32U)ICON_COPYDEL_FOCUS; 
								dir_hwnd->draw_info[3].draw_data = (INT32U)COPY_STR;     
	                            dir_hwnd->draw_info[2].draw_data = (INT32U)ICON_COPYDEL_LOSE;               
	                            dir_hwnd->draw_info[4].draw_data = (INT32U)DELETE_STR;                
	                            OperationBtnCurHi = 0;
								AWPostMessage(dir_hwnd, WM_PAINT_DRAW_INFO, 0) ;
		                        AWPostMessage(dir_hwnd, WM_PAINT_DRAW_INFO, 9) ;
								AWPostMessage(dir_hwnd, WM_PAINT_DRAW_INFO, 1) ;
								AWPostMessage(dir_hwnd, WM_PAINT_DRAW_INFO, 3) ;
								AWPostMessage(dir_hwnd, WM_PAINT_DRAW_INFO, 2) ;
								AWPostMessage(dir_hwnd, WM_PAINT_DRAW_INFO, 4) ;
								AWPostMessage(dir_hwnd, WM_PAINT_FINISH, 0) ;
							}
						}
		                else {
	                        AWHideWinControl(dir_hwnd) ;
	                        AWSetFocus(AWFindWinCtrlByName(FileListPreview));
	                        AWPostMessage(hwnd, WM_PAINT, 0) ;
		                }
		            }
				}
		        *key_value = UOP_NOP;
		            break;
			} 
			
		case UOP_MUTE:
			if(CheckMediaPlaybackApp()){
				
				if(GPIO_MUTE_STATUS){
					isMute = UNMUTE;
					GPIO_MB_UNMUTE;
				}
				else{
					isMute = MUTE;
					GPIO_MB_MUTE;
				}
			          		
				dir_hwnd = AWFindWinCtrlByName(WinFileVolume);
				if(dir_hwnd){
					AWShowWinControl(dir_hwnd, 0) ;
					
					if(isMute == UNMUTE) 
					{
						waitting = 0 ;
						dir_hwnd->draw_info[0].draw_data = (INT32U)ICON_VOLUME_BLANK;
						dir_hwnd->draw_info[1].draw_data = (INT32U)ICON_VOLUME_SPACE ;
					}
					else
					{
						dir_hwnd->draw_info[0].draw_data = (INT32U)ICON_VOLUME_MUTE;
						dir_hwnd->draw_info[1].draw_data = (INT32U)ICON_VOLUME_SPACE ;
					}
						AWPostMessage(dir_hwnd, WM_PAINT_DRAW_INFO, 0) ;
						AWPostMessage(dir_hwnd, WM_PAINT_DRAW_INFO, 1) ;
						AWPostMessage(dir_hwnd, WM_PAINT_FINISH, 0) ;
				}	
          	}
			break;
		 		
           	
		case UOP_STOP:
			if(CheckMediaPlaybackApp()){
		  		AWPostMessage(hwnd, WM_PAINT, 0) ;
          	  	AVTimerDelete(caption_moving_timer_3);
          	}
            	break;            	

		case UOP_VOL_MINUS:
       		case UOP_VOL_PLUS:
	          if(CheckMediaPlaybackApp())
	          	{
	          		waitting = 0 ;
				FLProcessVolume(*key_value);
				*key_value = UOP_NOP;
	          	}
	        		break; 
    }
    ClearPanelAction(key_value) ;
    return 0 ;
}


///////////////////////////////////////////////////////////////////////////////filelsit music update
void FLUpdateMusicTime(INT32S Time, INT32S TotalTime)
{
	INT32S min = 0 ;
	INT32S Sec = 0 ;
	min = Time/(60)	;
	Sec = Time%60 ;
	
	PHWND hwnd = AWFindWinCtrlByName(WinFileListProcessBar);
	if(hwnd)
	  AWShowWinControl(hwnd, 0) ;
	
}


INT32S FLgPlayerAppShowAudioID3Info()
{
    char *p_str,*str_get;
    INT16U StrLen;
    INT32S key = UOP_NOP ;
	
    PHWND dir_hwnd = AWFindWinCtrlByName(WinFileListMusicInfo) ;
//    if(dir_hwnd)
//      AWShowWinControl(dir_hwnd, 0) ;

         if((INT32U ) &pInfo){
 
	 str_get = AVMem_umalloc(60) ;
	 p_str = (char *)AWGetResource(TITLE, &StrLen);
        StrLen = (StrLen < 50)?StrLen:50 ;
        strncpy(str_get, p_str, StrLen);
        str_get[StrLen] = 0 ;
	 sprintf(debug_string[0],"%s",str_get) ;
        strcat(debug_string[0],pInfo.au_ID3_Tag.title);
		Cut_string(debug_string[0]);
	 AVMem_free(str_get);

	 str_get = AVMem_umalloc(60) ;
	 p_str = (char *)AWGetResource(ARTIST, &StrLen);
        StrLen = (StrLen < 50)?StrLen:50 ;
        strncpy(str_get, p_str, StrLen);
        str_get[StrLen] = 0 ;
	 sprintf(debug_string[1],"%s",str_get) ;
        strcat(debug_string[1],pInfo.au_ID3_Tag.artist);
		Cut_string(debug_string[1]);
	 AVMem_free(str_get);

	 str_get = AVMem_umalloc(60) ;
	 p_str = (char *)AWGetResource(ALBUM, &StrLen);
        StrLen = (StrLen < 50)?StrLen:50 ;
        strncpy(str_get, p_str, StrLen);
        str_get[StrLen] = 0 ;
	 sprintf(debug_string[2],"%s",str_get) ;
        strcat(debug_string[2],pInfo.au_ID3_Tag.album);
		Cut_string(debug_string[2]);
		
/*		dir_hwnd->draw_info[3].draw_data = (INT32U)0 ;
		dir_hwnd->draw_info[3].draw_type = DT_VOSD_DATA ;
		vosd_selfroll_string(dir_hwnd, 3,debug_string[2], 4, 66, &caption_moving_timer_3, caption_moving_time_func_3, 0);*/

	 AVMem_free(str_get);

	 str_get = AVMem_umalloc(60) ;
	 p_str = (char *)AWGetResource(YEAR, &StrLen);
        StrLen = (StrLen < 50)?StrLen:50 ;
        strncpy(str_get, p_str, StrLen);
        str_get[StrLen] = 0 ;
	 sprintf(debug_string[3],"%s",str_get) ;
        strcat(debug_string[3],pInfo.au_ID3_Tag.year);
		Cut_string(debug_string[3]);
	 AVMem_free(str_get);
#ifdef TV_MODE_1080P	
	if(CurrentOsdSize==OsdSize1080p){
		debug_string[0][32] = '\0';
		debug_string[1][32] = '\0';
		debug_string[2][32] = '\0';
		}
	else
#endif
#ifdef TV_MODE_720P	
	if(CurrentOsdSize==OsdSize720p){
		debug_string[0][32] = '\0';
		debug_string[1][32] = '\0';
		debug_string[2][32] = '\0';
		}
	else
#endif
		{
		debug_string[0][22] = '\0';
		debug_string[1][22] = '\0';
		debug_string[2][22] = '\0';	
		}
	if(dir_hwnd)
	AWShowWinControl(dir_hwnd, 0);  
	      key = UOP_NOP ;

    }
    return 0 ;
}

void FLgPlayerUpdateAudioTotalTime(INT32S total_time)
{
	INT32S time_min = 0 ;
	INT32S time_sec = 0 ;
	
	time_min = total_time/60 ;
	time_sec = total_time%60 ;
	
	sprintf(mediabox_time_str, "%02d:%02d", time_min, time_sec);
	
	PHWND hwnd = AWFindWinCtrlByName(WinFileListProcessBar);
	if(hwnd){
		hwnd->pClass->ClassProc(hwnd, WM_PAINT_DRAW_INFO, 2);
		hwnd->pClass->ClassProc(hwnd, WM_PAINT_DRAW_INFO, 3);
	}
	
	hwnd->pClass->ClassProc(hwnd, WM_PAINT_FINISH, 0) ; 
		
}

void FLUpdateAudioProcessBar(INT32S total_time, INT32S curr_time)
{
	
		PIXELVAL old_color;
	
	PHWND hwnd = AWFindWinCtrlByName(WinFileListProcessBar);
	if(hwnd){
		if(hwnd->draw_info[5].draw_data == (INT32U)0)
			hwnd->draw_info[5].draw_data = (INT32U)ICON_MUSIC_PROCESSBAR_BLANK;
			
		hwnd->pClass->ClassProc(hwnd, WM_PAINT_DRAW_INFO, 5);
		hwnd->pClass->ClassProc(hwnd, WM_PAINT_FINISH, 0) ; 
	}

	INT32S x = hwnd->draw_info[5].draw_pos_x ;
	INT32S y  = hwnd->draw_info[5].draw_pos_y ;
	INT32S h = hwnd->draw_info[5].draw_height ;
	INT32S w = hwnd->draw_info[5].draw_width ; 
			
	old_color = AWSetForeground(15);
	
	if(total_time>0){
		w = (w * curr_time);
		w = w / total_time ;
		if((w < hwnd->draw_info[5].draw_width)||(w == hwnd->draw_info[5].draw_width))
			AWFillRectTxt(x,y,w,h);
	}	
	AWSetForeground(old_color) ;

	return ;
}

void FLUpdateSpectrumDisplay(int *Data_Arrow)
{
    int Spectrum_height=0;
    int i=1;
    PHWND hwnd = AWFindWinCtrlByName(WinFileSpectrum) ;
    if(hwnd == NULL)
	return;
    hwnd->pClass->ClassProc(hwnd, WM_PAINT_DRAW_INFO, 0);
    for(i=1;i<15;i++)
    {
        Spectrum_height = GetDecibleVal(Data_Arrow[i]);
#ifdef TV_MODE_1080P
	if(CurrentOsdSize==OsdSize1080p){
		if(hwnd->draw_info[i].draw_data!=(INT32U)SpeTable_14[Spectrum_height])
			{
				hwnd->draw_info[i].draw_data=(INT32U)SpeTable_14[Spectrum_height];
				hwnd->pClass->ClassProc(hwnd, WM_PAINT_DRAW_INFO, i) ;
			}
		}
	else
#endif
#ifdef TV_MODE_720P
	if(CurrentOsdSize==OsdSize720p){
		if(hwnd->draw_info[i].draw_data!=(INT32U)SpeTable_14[Spectrum_height])
			{
				hwnd->draw_info[i].draw_data=(INT32U)SpeTable_14[Spectrum_height];
				hwnd->pClass->ClassProc(hwnd, WM_PAINT_DRAW_INFO, i) ;
			}
		}
	else
#endif
		{
		if(hwnd->draw_info[i].draw_data!=(INT32U)SpeTable_8[Spectrum_height])
			{
				hwnd->draw_info[i].draw_data=(INT32U)SpeTable_8[Spectrum_height];
				hwnd->pClass->ClassProc(hwnd, WM_PAINT_DRAW_INFO, i) ;
			}
		}
    }
	hwnd->pClass->ClassProc(hwnd, WM_PAINT_FINISH, 0);
}
#ifdef ENABLE_NETWORK
	INT32U key_value_enter=0;
#endif

INT32S FileListPreviewOnOtherEvent(PHWND hwnd, INT32U msg_type, INT32S lpParam)
{
	INT8U my_app_id ;
	if(isMute == MUTE)
		return 0 ;
		
	switch(msg_type){
		case WM_SECOND_TIMEOUT:
			PHWND dir_hwnd = AWFindWinCtrlByName(WinFileVolume);
			if(dir_hwnd == NULL)
				break;
			if(AWIsVisibleWinControl(dir_hwnd)){
				if(waitting<WaitFor)
					waitting++;
				else{
					dir_hwnd->draw_info[0].draw_data = (INT32U)ICON_VOLUME_BLANK ;
					dir_hwnd->draw_info[1].draw_data = (INT32U)ICON_VOLUME_SPACE;
					dir_hwnd->pClass->ClassProc(dir_hwnd,WM_PAINT_DRAW_INFO,0) ;
					dir_hwnd->pClass->ClassProc(dir_hwnd,WM_PAINT_DRAW_INFO,1) ;
					dir_hwnd->pClass->ClassProc(dir_hwnd,WM_PAINT_FINISH,0) ;
					
				}	
			}
	#ifdef ENABLE_NETWORK
            if(playnextflg==1)
            {
            /*    			 if(MP3key_Counter<1)
             	{
                 MP3key_Counter++;
            	 return 0;
                }*/
             AWGetAppID(MEDIA_GENERAL, &my_app_id) ; 
             if (AWGetAppStatus(my_app_id) == APP_RUNNING) 
                return;
             playnextflg=0;	
             key_value_enter=UOP_ENTER; 
             AWPostMessage(hwnd, WM_KEYDOWN,(INT32U) &key_value_enter);
            }		
#endif
		
			break;
	}
	return 0 ;
}

INT32S FileListPreviewOnPaint(PHWND hwnd, INT32S lpParam)
{
	CHARSTR* dir_path = NULL;
    	INT32U file_index ;
	TFILELIST *pList = (TFILELIST *)hwnd ;
	 INT8U my_app_id ;
	hwnd->pClass->ClassProc(hwnd, WM_PAINT, 1);
	file_index = pList->filelist_items[pList->focused_item_index].filelist_item_id ;
	dir_path = FileNavGetCurrDir();
	PHWND dir_hwnd = AWFindWinCtrlByName(StringRotate);
		
	if(!AWCheckPlayListItemExist(dir_path, MEDIA_MP3,file_index)){
	 	AVTimerDelete(caption_moving_timer_1);
	 	
		if((dir_hwnd->draw_info[1].draw_data)&&
		   (dir_hwnd->draw_info[1].draw_type == DT_VOSD_DATA)){
			AWVOSDDestrory((VOSD*)dir_hwnd->draw_info[1].draw_data);
			dir_hwnd->draw_info[1].draw_data = (INT32U)0 ;
		}
	 	String_roll_state_file = ROLL ;
	}
	else { 
		if((dir_hwnd->draw_info[1].draw_data)&&
		   (dir_hwnd->draw_info[1].draw_type == DT_VOSD_DATA)){
			AWVOSDDestrory((VOSD*)dir_hwnd->draw_info[1].draw_data);
			dir_hwnd->draw_info[1].draw_data = (INT32U)0 ;
		}
		String_roll_state_file = UNROLL ;
	}
	
	return 1 ;	
}

INT32S WinFileVolumeOnShow(PHWND hwnd, INT32S lpParam)
{
    return 0 ;
}
INT32S WinFileVolumeOnPaint(PHWND hwnd, INT32S lpParam)
{
    return 0 ;
}
INT32S WinFileVolumeOnKeyPress(PHWND hwnd, INT32S lpParam)
{
    return 0 ;
}
INT32S WinFileListProcessBarOnShow(PHWND hwnd, INT32S lpParam)
{
    return 0 ;
}
INT32S WinFileListCopyDelBKGOnPaint(PHWND hwnd, INT32S lpParam)
{
    return 0 ;
}


static FileCopyDelRefreshProcess(PHWND hwnd)
{
    if(file_status != SYS_FINISH_FILE)
    {
    
            icon_copying_flag = 1-icon_copying_flag;
            if(icon_copying_flag)
                hwnd->draw_info[10].draw_data = (INT32U)ICON_COPYINGFILE2 ;
            else
                hwnd->draw_info[10].draw_data = (INT32U)ICON_COPYINGFILE1 ;
            AWPostMessage(hwnd, WM_PAINT_DRAW_INFO, 10) ;
            
    }
        
}

INT32S WinFileListCopyDelBKGOnOtherEvent(PHWND hwnd, INT32U msg_type, INT32S lpParam)
{
    switch(msg_type){
        case WM_SECOND_TIMEOUT:
            if(Copying_flag==1) {
                FileCopyDelRefreshProcess(hwnd) ;
           }
            break;
    }
    return 0 ;
}

INT32S WinUpdateSysPlayStatus(INT8U status, INT8U percent)              
{
    PHWND hwnd = AWFindWinCtrlByName(WinFileListCopyDelBKG) ;
    file_status = status ;
    if(hwnd == NULL)
        return 0 ;
    if(AWIsVisibleWinControl(hwnd)) {
        if(status == SYS_FINISH_FILE) {
		
			AWClearPlaylist(MEDIA_GENERAL) ;
			EnterSelect_flag=1;
			Deleting_Flag=0;
			hwnd->draw_info[0].draw_data = (INT32U)ICON_COPYDEL_BKG;
			hwnd->draw_info[11].draw_data = (INT32U)ICON_COPYDEL_BIG; 
			hwnd->draw_info[1].draw_data = (INT32U)ICON_COPYDEL_LOSE;
			
			if(Copying_flag)
			{
				hwnd->draw_info[3].draw_data = (INT32U)COPY_STR;
			}
			else
			{
				hwnd->draw_info[3].draw_data = (INT32U)DELETE_STR;
			}
			
			Copying_flag=0;
			hwnd->draw_info[2].draw_data = (INT32U)ICON_COPYDEL_LOSE;
			hwnd->draw_info[26].draw_data = (INT32U)infobar_filename;
			hwnd->draw_info[16].draw_data = (INT32U)ICON_COPYDEL_FINISHED;
			
			if(Cancel_Flag)
			{
				hwnd->draw_info[17].draw_data = (INT32U)CANCELLED_STR;
			}
			else
			{
				hwnd->draw_info[17].draw_data = (INT32U)FINISHED_STR;
			}
			
			Cancel_Flag=0;
		    OperationBtnCurHi = 0;
			AWPostMessage(hwnd, WM_PAINT_DRAW_INFO, 0) ;
		    AWPostMessage(hwnd, WM_PAINT_DRAW_INFO, 11) ;
			AWPostMessage(hwnd, WM_PAINT_DRAW_INFO, 1) ;
			AWPostMessage(hwnd, WM_PAINT_DRAW_INFO, 3) ;
			AWPostMessage(hwnd, WM_PAINT_DRAW_INFO, 2) ;
			AWPostMessage(hwnd, WM_PAINT_DRAW_INFO, 26) ;
			AWPostMessage(hwnd, WM_PAINT_DRAW_INFO, 16) ;
			AWPostMessage(hwnd, WM_PAINT_DRAW_INFO, 17) ;
		}
        
		else if(status == SYS_COPY_FILE) {
			Copying_flag=1;
			snprintf(COPYDEL_STATUS_STR,sizeof(COPYDEL_STATUS_STR),"%s",COPY_STRING);
			hwnd->draw_info[1].draw_data = (INT32U)ICON_COPYDEL_LOSE;
			hwnd->draw_info[3].draw_data = (INT32U)COPY_STR;
		    hwnd->draw_info[2].draw_data = (INT32U)ICON_COPYDEL_LOSE;
		    hwnd->draw_info[26].draw_data = (INT32U)COPYDEL_STR;
			hwnd->draw_info[21].draw_data = (INT32U)ICON_COPYDEL_FINISHED;
			hwnd->draw_info[22].draw_data = (INT32U)CANCEL_STR;
			AWPostMessage(hwnd, WM_PAINT_DRAW_INFO, 1) ;
			AWPostMessage(hwnd, WM_PAINT_DRAW_INFO, 3) ;
			AWPostMessage(hwnd, WM_PAINT_DRAW_INFO, 2) ;
			AWPostMessage(hwnd, WM_PAINT_DRAW_INFO, 26) ;
			AWPostMessage(hwnd, WM_PAINT_DRAW_INFO, 21) ;
			AWPostMessage(hwnd, WM_PAINT_DRAW_INFO, 22) ;
		}
		else if(status == SYS_DEL_FILE) {
		 	EnterSelect_flag=1;
			Copying_flag=0;
			snprintf(COPYDEL_STATUS_STR,sizeof(COPYDEL_STATUS_STR),"%s",DELETE_STRING);
			hwnd->draw_info[1].draw_data = (INT32U)ICON_COPYDEL_LOSE;
			hwnd->draw_info[3].draw_data = (INT32U)DELETE_STR;
		    hwnd->draw_info[2].draw_data = (INT32U)ICON_COPYDEL_LOSE;
		    hwnd->draw_info[26].draw_data = (INT32U)infobar_filename;
			AWPostMessage(hwnd, WM_PAINT_DRAW_INFO, 1) ;
			AWPostMessage(hwnd, WM_PAINT_DRAW_INFO, 3) ;
			AWPostMessage(hwnd, WM_PAINT_DRAW_INFO, 2) ;
			AWPostMessage(hwnd, WM_PAINT_DRAW_INFO, 26) ;
		}
		else if(status == SYS_ERROR) {
			Copying_flag=0;
			Deleting_Flag=0;
	        AWClearPlaylist(MEDIA_GENERAL) ;
		 	EnterSelect_flag=1;
			hwnd->draw_info[0].draw_data = (INT32U)ICON_COPYDEL_BKG;
			hwnd->draw_info[11].draw_data = (INT32U)ICON_COPYDEL_BIG; 
			hwnd->draw_info[1].draw_data = (INT32U)ICON_COPYDEL_LOSE;
			hwnd->draw_info[25].draw_data = (INT32U)COPYDEL_STATUS_STR;
		    hwnd->draw_info[2].draw_data = (INT32U)ICON_COPYDEL_LOSE;
		    hwnd->draw_info[26].draw_data = (INT32U)COPYDEL_STR;
			hwnd->draw_info[16].draw_data = (INT32U)ICON_COPYDEL_FINISHED;
			hwnd->draw_info[17].draw_data = (INT32U)ERROR_STR;
		    OperationBtnCurHi = 0;
			AWPostMessage(hwnd, WM_PAINT_DRAW_INFO, 0) ;
		    AWPostMessage(hwnd, WM_PAINT_DRAW_INFO, 11) ;
			AWPostMessage(hwnd, WM_PAINT_DRAW_INFO, 1) ;
			AWPostMessage(hwnd, WM_PAINT_DRAW_INFO, 25) ;
			AWPostMessage(hwnd, WM_PAINT_DRAW_INFO, 2) ;
			AWPostMessage(hwnd, WM_PAINT_DRAW_INFO, 26) ;
			AWPostMessage(hwnd, WM_PAINT_DRAW_INFO, 16) ;
			AWPostMessage(hwnd, WM_PAINT_DRAW_INFO, 17) ;
		}
		AWPostMessage(hwnd, WM_PAINT_FINISH, 0) ;	
    }
    return 0 ;
}


INT32S String_Updata_FileName(char *file_path, char *dest, INT32S pix_length)
{
    char *name ;
    char *file_name_pos ;
    INT32S paint_str_len, word_length, font_height ;

    if(file_path){
        file_name_pos = strrchr(file_path, '/') ;
        if(file_name_pos)
	 {
            name = &file_name_pos[1] ;
            strncpy(dest, name, 255) ;
            dest[255] = 0 ;
            paint_str_len = AWGetTextSize(dest, 0,&pix_length,&font_height,&word_length, AWTF_ASCII) ;
            dest[paint_str_len] = 0 ;
        }
        else
	 {
            return 1;
        }
        
    }
    else
    {
        return 1;
    }
    return 0;
}


INT32S WinFileListCopyDelBKGOnKeyPress(PHWND hwnd, INT32S lpParam)
{
    INT32U *key_value = (INT32U *)lpParam ;
    static char *gCopyFilename=NULL, *gPasteFileName=NULL;
    PHWND dir_hwnd ;
    PHWND paint_hwnd;

    TFILELIST *pList = (TFILELIST *)AWFindWinCtrlByName(WinFileListCopyDel) ; 
    PHWND ctr_handle = NULL;
    char *file_name ;
    if(pList == NULL)
        return -1;

    switch(*key_value){
	#ifdef WISTAR_VERSION
	case UOP_RESUME:
	#endif
        case UOP_OSD:
		if(EnterSelect_flag==1)
			break;
		else{
			AWClearPlaylist(MEDIA_GENERAL) ;
			del_flag = 0 ;
	              AWHideWinControl(hwnd) ;
			paint_hwnd=AWFindWinCtrlByName(WinFileInfoBKG) ;
			if(paint_hwnd)
				AWPostMessage(paint_hwnd, WM_PAINT, 0) ;
				dir_hwnd = AWFindWinCtrlByName(FileListPreview) ;
			if(dir_hwnd)
				AWSetFocus(dir_hwnd);
				
				FileNavCD(GetSavedPath());
				FileNavSeek(CurrentIndex) ;
				dir_hwnd->pClass->ClassProc(dir_hwnd, WM_T_FILELIST_REFRESH, -1);
				FileListPreviewCheck(dir_hwnd);
				AWPostMessage(dir_hwnd, WM_PAINT, 0) ;
				*key_value = UOP_NOP ;
			}
             return 1;
        case UOP_DOWN:
		if(EnterSelect_flag==1 ||del_flag == 1 || Copying_flag ==1)
			break;
	       else if(OperationBtnCurHi==0)//copy
		{
			hwnd->draw_info[9].draw_data = (INT32U)ICON_COPYDEL_SMALL; 
			hwnd->draw_info[1].draw_data = (INT32U)ICON_COPYDEL_LOSE; 
			hwnd->draw_info[3].draw_data = (INT32U)COPY_STR;     
	              hwnd->draw_info[2].draw_data = (INT32U)ICON_COPYDEL_FOCUS;               
	              hwnd->draw_info[4].draw_data = (INT32U)DELETE_STR;                
	              OperationBtnCurHi = 1;
	              AWPostMessage(hwnd, WM_PAINT_DRAW_INFO, 9) ;
			AWPostMessage(hwnd, WM_PAINT_DRAW_INFO, 1) ;
			AWPostMessage(hwnd, WM_PAINT_DRAW_INFO, 3) ;
			AWPostMessage(hwnd, WM_PAINT_DRAW_INFO, 2) ;
			AWPostMessage(hwnd, WM_PAINT_DRAW_INFO, 4) ;
			AWPostMessage(hwnd, WM_PAINT_FINISH, 0) ;
		}
            break;
        case UOP_UP:
		if(EnterSelect_flag==1 ||del_flag == 1 || Copying_flag ==1)
			break;
		else if(OperationBtnCurHi==1)//del
		{
			hwnd->draw_info[9].draw_data = (INT32U)ICON_COPYDEL_SMALL; 
			hwnd->draw_info[1].draw_data = (INT32U)ICON_COPYDEL_FOCUS; 
			hwnd->draw_info[3].draw_data = (INT32U)COPY_STR;     
	              hwnd->draw_info[2].draw_data = (INT32U)ICON_COPYDEL_LOSE;               
	              hwnd->draw_info[4].draw_data = (INT32U)DELETE_STR;                
	              OperationBtnCurHi = 0;
	              AWPostMessage(hwnd, WM_PAINT_DRAW_INFO, 9) ;
			AWPostMessage(hwnd, WM_PAINT_DRAW_INFO, 1) ;
			AWPostMessage(hwnd, WM_PAINT_DRAW_INFO, 3) ;
			AWPostMessage(hwnd, WM_PAINT_DRAW_INFO, 2) ;
			AWPostMessage(hwnd, WM_PAINT_DRAW_INFO, 4) ;
			AWPostMessage(hwnd, WM_PAINT_FINISH, 0) ;
		}
            break;
        case UOP_ENTER:
	     if(Deleting_Flag)
		 	break;
            if(Copying_flag ==1)    //Rex_Chen Add For Cancel Copy
            {
                FileOperationCancel();
		  Cancel_Flag = 1 ;
                return 1;    
            }
		if((del_highlight == 1) && (del_flag == 1))
		{
			del_flag = 0 ;
                    file_name = AWGetFirstPlaylistItem(MEDIA_GENERAL) ;
                    if(file_name)
		      {
				Deleting_Flag = 1;
				AWSysCopyDelFile(file_name, SYS_DEL_FILE) ;
				*key_value = UOP_NOP ;
				return 1 ;
		      }
		}
		else if((del_highlight == 0) && (del_flag == 1))
		{
			AWClearPlaylist(MEDIA_GENERAL) ;
			del_flag = 0 ;
			AWHideWinControl(hwnd) ;
			paint_hwnd=AWFindWinCtrlByName(WinFileInfoBKG) ;
			if(paint_hwnd)
				AWPostMessage(paint_hwnd, WM_PAINT, 0) ;
				dir_hwnd = AWFindWinCtrlByName(FileListPreview) ;
			if(dir_hwnd)
				AWSetFocus(dir_hwnd);
				AWPostMessage(dir_hwnd, WM_PAINT, 0) ;
				*key_value = UOP_NOP;
			break;
		}
			
		if(EnterSelect_flag==1) 
		{
		   EnterSelect_flag=0;

			dir_hwnd = AWFindWinCtrlByName(FileListPreview) ;
		     	AWSetFocus(dir_hwnd) ;		 
		     	dir_hwnd->pClass->ClassProc(dir_hwnd, WM_T_FILELIST_REFRESH, -1);	  

		       paint_hwnd = AWFindWinCtrlByName(WinFileListCopyDelBKG);
		       if(paint_hwnd)
				paint_hwnd->draw_info[0].draw_data = (INT32U)ICON_COPYDEL_BKG;
				AWPostMessage(hwnd, WM_PAINT_DRAW_INFO, 0) ;
				AWPostMessage(hwnd, WM_PAINT_FINISH, 0) ;
				paint_hwnd->style |=WS_DISVISIBLE;
			GUIHideWindow(WinFileList);
			FileListOnShowFlag=0;
			GUIShowWindow(WinFileList);
		}
		else 
		{
		            switch(OperationBtnCurHi)
		            {
		                case 0://copy
					hwnd->draw_info[0].draw_data = (INT32U)ICON_COPYDEL_BKG;
					hwnd->draw_info[18].draw_data = (INT32U)ICON_COPYDEL_SMALL; 
					hwnd->draw_info[5].draw_data = (INT32U)ICON_COPYDEL_LOSE; 
					hwnd->draw_info[7].draw_data = (INT32U)COPY_STR;     
					hwnd->draw_info[6].draw_data = (INT32U)ICON_COPYDEL_LOSE;               
					hwnd->draw_info[8].draw_data = (INT32U)COPYDEL_STR; 
				//	hwnd->draw_info[19].draw_data = (INT32U)ICON_FILELIST_UP; //evan:2007_11_9 modify
					hwnd->draw_info[20].draw_data = (INT32U)ICON_FILELIST_DOWN; 
					AWSendMessage(hwnd, WM_PAINT_DRAW_INFO, 0) ;
					AWSendMessage(hwnd, WM_PAINT_DRAW_INFO, 18) ;
					AWSendMessage(hwnd, WM_PAINT_DRAW_INFO, 5) ;
					AWSendMessage(hwnd, WM_PAINT_DRAW_INFO, 7) ;
					AWSendMessage(hwnd, WM_PAINT_DRAW_INFO, 6) ;
					AWSendMessage(hwnd, WM_PAINT_DRAW_INFO, 8) ;
					AWSendMessage(hwnd, WM_PAINT_DRAW_INFO, 19) ;
					AWSendMessage(hwnd, WM_PAINT_DRAW_INFO, 20) ;
					AWSendMessage(hwnd, WM_PAINT_FINISH, 0) ;
					
					paint_hwnd = AWFindWinCtrlByName(WinFileListBKG);
					if(paint_hwnd == NULL)
						break;
					paint_hwnd->draw_info[7].draw_data = (INT32U)ICON_TIP_BLANK_480;
					paint_hwnd->draw_info[8].draw_data = (INT32U)TIPS3_STR;
					AWSendMessage(paint_hwnd, WM_PAINT_DRAW_INFO,7);
					AWSendMessage(paint_hwnd, WM_PAINT_DRAW_INFO,8);
					AWSendMessage(paint_hwnd, WM_PAINT_FINISH, 0);
					
				       dir_hwnd = AWFindWinCtrlByName(WinFileListCopyDel) ;
				       if(dir_hwnd == NULL)
						break;
					ONLYDIR_FLAG=1;
					FileListOnShowFlag = 0;
		                     AWShowWinControl(dir_hwnd, 0) ;
		                   	AWSetFocus(dir_hwnd) ;
					dir_hwnd->pClass->ClassProc(dir_hwnd, WM_T_FILELIST_REFRESH, -1);
		                        *key_value = UOP_NOP ;
		                        return 1 ;
//		                    break;
		               case 1://del
					memset(COPYDEL_STR,0,sizeof(COPYDEL_STR));
					hwnd->draw_info[0].draw_data = (INT32U)ICON_COPYDEL_BKG;
					hwnd->draw_info[11].draw_data = (INT32U)ICON_COPYDEL_BIG;
					hwnd->draw_info[1].draw_data = (INT32U)ICON_COPYDEL_LOSE;
					hwnd->draw_info[3].draw_data = (INT32U)DELETE_STR;
					hwnd->draw_info[2].draw_data = (INT32U)ICON_COPYDEL_LOSE;
					hwnd->draw_info[26].draw_data = (INT32U)COPYDEL_STR;
					hwnd->draw_info[23].draw_data = (INT32U)ICON_YES_LOSE;
					hwnd->draw_info[24].draw_data = (INT32U)ICON_NO_FOCUS; 		
					AWSendMessage(hwnd, WM_PAINT_DRAW_INFO, 0) ;
					AWSendMessage(hwnd, WM_PAINT_DRAW_INFO, 11) ;
					AWSendMessage(hwnd, WM_PAINT_DRAW_INFO, 1) ;
					AWSendMessage(hwnd, WM_PAINT_DRAW_INFO, 3) ;
					AWSendMessage(hwnd, WM_PAINT_DRAW_INFO, 2) ;
					AWSendMessage(hwnd, WM_PAINT_DRAW_INFO, 26) ;
					AWSendMessage(hwnd, WM_PAINT_DRAW_INFO, 23) ;
					AWSendMessage(hwnd, WM_PAINT_DRAW_INFO, 24) ;
					AWSendMessage(hwnd, WM_PAINT_FINISH, 0) ;
					del_highlight = 0;
					del_flag = 1;
//		                    }

		                    break;
		                default:
		                    break;
		            }

			}
		break;
        case UOP_LEFT:
 	 case UOP_RIGHT:
	 	if(del_flag == 1)
		{
			if ((*key_value) == UOP_LEFT)//yes
			{
				del_highlight = 1;
				hwnd->draw_info[23].draw_data = (INT32U)ICON_YES_FOCUS;
				hwnd->draw_info[24].draw_data = (INT32U)ICON_NO_LOSE;
			}
			else if((*key_value) == UOP_RIGHT)//no
			{	
				del_highlight = 0;
				hwnd->draw_info[23].draw_data = (INT32U)ICON_YES_LOSE;
				hwnd->draw_info[24].draw_data = (INT32U)ICON_NO_FOCUS;
			}
		    AWPostMessage(hwnd, WM_PAINT_DRAW_INFO, 23) ;
		    AWPostMessage(hwnd, WM_PAINT_DRAW_INFO, 24) ;
		    AWPostMessage(hwnd, WM_PAINT_FINISH, 0) ;
            return 1;
		}
       default:
            break;
    }
    *key_value = UOP_NOP;
     return 1 ;
}


INT32S WinFileListCopyDelOnShow(PHWND hwnd, INT32S lpParam)
{
    TFILELIST *pList = (TFILELIST *)hwnd ;
    INT8U my_app_id ;
    
    AWGetAppID(MEDIA_GENERAL, &my_app_id) ; 
    if (FileListOnShowFlag == 0) 
    {
        FileListOnShowFlag = 1 ;
        pList->focused_item_index = 0 ;
        pList->first_item_index = 0 ;
        pList->list_levels = 0 ;
        pList->filelist_status &= ~T_FILELIST_DISVISABLE ;
        pList->filelist_status &= ~T_FILELIST_SHOW_UP_ARROW ;

        pList->filelist_status &= ~T_FILELIST_HAVE_SELECT_ITEM ;
        pList->cd_root_entry(pList->total_items, pList->filelist_items) ;

        if(pList->get_next_entrys(0, pList->total_items, pList->filelist_items))
            pList->filelist_status |= T_FILELIST_SHOW_DOWN_ARROW ;
        else
            pList->filelist_status &= ~T_FILELIST_SHOW_DOWN_ARROW ;
    }   
    return 1 ;    
}

INT32S WinFileListCopyDelOnPaint(PHWND hwnd, INT32S lpParam)
{
	return 0;
}

INT32S WinFileListCopyDelOnKeyPress(PHWND hwnd, INT32S lpParam)
{
    PHWND dir_hwnd, paint_hwnd;
    TFILELIST *pList = (TFILELIST *)hwnd ;
    INT32U *key_value = (INT32U *)lpParam ;
    char *dir_path ,*item_name;
    INT32U file_index ;
    INT32U item_type ;
    char dbg_path[16];
    
    switch(*key_value){
	 case UOP_RESUME:
	 	 if(hwnd)
		 	AWHideWinControl(hwnd) ;
                dir_hwnd = AWFindWinCtrlByName(WinFileListCopyDelBKG) ;
                if(dir_hwnd){
			ONLYDIR_FLAG=0;
                        item_name = AWGetFirstPlaylistItem(MEDIA_GENERAL) ;
				dir_hwnd->style &= ~WS_DISVISIBLE;//AWShowWinControl(dir_hwnd, 0) ;
	                   	AWSetFocus(dir_hwnd) ;
				dir_hwnd->draw_info[0].draw_data = (INT32U)ICON_COPYDEL_BKG;
				dir_hwnd->draw_info[9].draw_data = (INT32U)ICON_COPYDEL_SMALL; 
				dir_hwnd->draw_info[1].draw_data = (INT32U)ICON_COPYDEL_FOCUS; 
				dir_hwnd->draw_info[3].draw_data = (INT32U)COPY_STR;     
                            dir_hwnd->draw_info[2].draw_data = (INT32U)ICON_COPYDEL_LOSE;               
                            dir_hwnd->draw_info[4].draw_data = (INT32U)DELETE_STR;                
                            OperationBtnCurHi = 0;
				AWPostMessage(dir_hwnd, WM_PAINT_DRAW_INFO, 0) ;
                            AWPostMessage(dir_hwnd, WM_PAINT_DRAW_INFO, 9) ;
				AWPostMessage(dir_hwnd, WM_PAINT_DRAW_INFO, 1) ;
				AWPostMessage(dir_hwnd, WM_PAINT_DRAW_INFO, 3) ;
				AWPostMessage(dir_hwnd, WM_PAINT_DRAW_INFO, 2) ;
				AWPostMessage(dir_hwnd, WM_PAINT_DRAW_INFO, 4) ;
				AWPostMessage(dir_hwnd, WM_PAINT_FINISH, 0) ;

				paint_hwnd = AWFindWinCtrlByName(WinFileListBKG);
				if(paint_hwnd == NULL)
					break;
				paint_hwnd->draw_info[7].draw_data = (INT32U)ICON_TIP_BLANK_480;
				paint_hwnd->draw_info[8].draw_data = (INT32U)0;
				AWSendMessage(paint_hwnd, WM_PAINT_DRAW_INFO,7);
				AWSendMessage(paint_hwnd, WM_PAINT_DRAW_INFO,8);
				AWSendMessage(paint_hwnd, WM_PAINT_FINISH, 0);

                }
            *key_value = UOP_NOP;
            break;
        case UOP_LEFT:
		if(pList->list_levels==0)
			break;
		if(pList->list_levels == 1)
		{
			hwnd->pClass->ClassProc(hwnd, WM_KEYDOWN, lpParam) ;//call original fun first
			AWPostMessage(hwnd, WM_PAINT, 0) ;
			dir_hwnd = AWFindWinCtrlByName(WinFileListCopyDelBKG) ;
			if(dir_hwnd)
			{
				dir_path = FileNavGetCurrDir() ;
				FormatFileName_StringCat(dbg_path, dir_path, sizeof(dbg_path));
				memset(COPYDEL_STR,0,sizeof(COPYDEL_STR));
				snprintf(COPYDEL_STR,sizeof(COPYDEL_STR),"%s",dbg_path);
//				Cut_string(COPYDEL_STR);
				dir_hwnd->draw_info[6].draw_data = (INT32U)ICON_COPYDEL_LOSE;
				dir_hwnd->draw_info[8].draw_data = (INT32U)COPYDEL_STR;
				AWPostMessage(dir_hwnd, WM_PAINT_DRAW_INFO, 6) ;
				AWPostMessage(dir_hwnd, WM_PAINT_DRAW_INFO, 8) ;
				AWPostMessage(dir_hwnd, WM_PAINT_FINISH, 0) ;			
			}
	            return 1 ;
            }
            hwnd->pClass->ClassProc(hwnd, WM_KEYDOWN, lpParam) ;//call original fun first
            AWPostMessage(hwnd, WM_PAINT_HELP_INFO, 0) ;
               dir_hwnd = AWFindWinCtrlByName(WinFileListCopyDelBKG) ;
                if(dir_hwnd){
			dir_path = FileNavGetCurrDir() ;
			FormatFileName_StringCat(dbg_path, dir_path, sizeof(dbg_path));
			memset(COPYDEL_STR,0,sizeof(COPYDEL_STR));
			snprintf(COPYDEL_STR,sizeof(COPYDEL_STR),"%s",dbg_path);
//			Cut_string(COPYDEL_STR);
			dir_hwnd->draw_info[6].draw_data = (INT32U)ICON_COPYDEL_LOSE;
			dir_hwnd->draw_info[8].draw_data = (INT32U)COPYDEL_STR;
			AWPostMessage(dir_hwnd, WM_PAINT_DRAW_INFO, 6) ;
                    	AWPostMessage(dir_hwnd, WM_PAINT_DRAW_INFO, 8) ;
			AWPostMessage(dir_hwnd, WM_PAINT_FINISH, 0) ;			
                }
		  return 1 ;
        case UOP_RIGHT:
            if(!((pList->filelist_items[pList->focused_item_index].filelist_item_status & (ITEM_IS_DIRECTORY))==(ITEM_IS_DIRECTORY)))
            {
                file_index = pList->filelist_items[pList->focused_item_index].filelist_item_id ;
                item_name = GetFullName(file_index, &item_type) ;
                if(!AWCheckPlayListItemExist(item_name, MEDIA_GENERAL, file_index)) 
		  {
                    AWRemovePlaylistItem(item_name, MEDIA_GENERAL, (INT16U)file_index) ;
                }
                else 
		  {
                    AWAddPlaylistItem(item_name, MEDIA_GENERAL, (INT16U)file_index) ;
                }
                pList->filelist_status |= T_FILELIST_PAINT_ITEM ;
                pList->filelist_items[pList->focused_item_index].filelist_item_status |= ITEM_UPDATE ;
                AWPostMessage(hwnd, WM_PAINT, 0) ;
		  return 1;
            }
            hwnd->pClass->ClassProc(hwnd, WM_KEYDOWN, lpParam) ;//call original fun first
            AWPostMessage(hwnd, WM_PAINT_HELP_INFO, 0) ;
            if(pList->list_levels > 0)
		{
                dir_hwnd = AWFindWinCtrlByName(WinFileListCopyDelBKG) ;
		      if(dir_hwnd)
			{
				dir_path = FileNavGetCurrDir() ;
				FormatFileName_StringCat(dbg_path, dir_path, sizeof(dbg_path));
				memset(COPYDEL_STR,0,sizeof(COPYDEL_STR));
				snprintf(COPYDEL_STR,sizeof(COPYDEL_STR),"%s",dbg_path);
//				Cut_string(COPYDEL_STR);
				dir_hwnd->draw_info[6].draw_data = (INT32U)ICON_COPYDEL_LOSE;
				dir_hwnd->draw_info[8].draw_data = (INT32U)COPYDEL_STR;
				AWPostMessage(dir_hwnd, WM_PAINT_DRAW_INFO, 6) ;
				AWPostMessage(dir_hwnd, WM_PAINT_DRAW_INFO, 8) ;
				AWPostMessage(dir_hwnd, WM_PAINT_FINISH, 0) ;			
			}
		}
            return 1 ;
        case UOP_DOWN:    
        case UOP_UP:    
			if(CheckMediaPlaybackApp())
				break;
          	else
	   		{
				hwnd->pClass->ClassProc(hwnd, WM_KEYDOWN, lpParam) ;//call original fun first
				AWPostMessage(hwnd, WM_PAINT_HELP_INFO, 0) ;   
          	}                
            return 1 ;
            
        case UOP_ENTER:
			if(pList->list_levels==0)
				break;
	 	 	if(hwnd){
		 		AWHideWinControl(hwnd) ;
		 	}
			dir_hwnd = AWFindWinCtrlByName(WinFileListCopyDelBKG) ;
            if(dir_hwnd){
				ONLYDIR_FLAG=0;
                if(dir_hwnd->style & WS_DISVISIBLE)
                AWShowWinControl(dir_hwnd, 0) ;
                AWSetFocus(dir_hwnd) ;
				item_name = AWGetFirstPlaylistItem(MEDIA_GENERAL) ;

				dir_hwnd->draw_info[0].draw_data = (INT32U)ICON_COPYDEL_BKG;
				dir_hwnd->draw_info[11].draw_data = (INT32U)ICON_COPYDEL_SMALL; 
				AWSendMessage(dir_hwnd, WM_PAINT_DRAW_INFO, 0) ;
   				AWSendMessage(dir_hwnd, WM_PAINT_DRAW_INFO, 11) ;
				AWSendMessage(dir_hwnd, WM_PAINT_FINISH, 0) ;
			}

			paint_hwnd = AWFindWinCtrlByName(WinFileListBKG);
			if(paint_hwnd == NULL)
				break;
			paint_hwnd->draw_info[7].draw_data = (INT32U)ICON_TIP_BLANK_480;
			paint_hwnd->draw_info[8].draw_data = (INT32U)0;
			AWSendMessage(paint_hwnd, WM_PAINT_DRAW_INFO,7);
			AWSendMessage(paint_hwnd, WM_PAINT_DRAW_INFO,8);
			AWSendMessage(paint_hwnd, WM_PAINT_FINISH, 0);
					
            AWSysCopyDelFile(item_name, SYS_COPY_FILE) ;
            *key_value = UOP_NOP ;
            	return 1 ;
    	}
    ClearPanelAction(key_value) ;
    return 0 ;
}

void FLupdateAudioPlayStateWhenMsgProc(AWMSG *pMsg, INT8U ff_level, INT8U fb_level)
{
	PHWND dir_hwnd=AWFindWinCtrlByName(FileListPreview);
	if(dir_hwnd == NULL)
		return;
	TFILELIST *pList = (TFILELIST *)dir_hwnd ;
   	char *item_name;
   	INT32U file_index ;
	INT32U item_type ;

	PHWND hwnd = AWFindWinCtrlByName(WinFileListProcessBar);
	
	if(!hwnd)
		return ;
	switch(pMsg->msg_value){
		case GPLAYER_PLAY:
			hwnd->draw_info[1].draw_data = (INT32U)ICON_INFO_PLAY;
			hwnd->draw_info[4].draw_data = (INT32U)ICON_INFO_BLANK;
			AudioStatus = AUDIO_PLAY;
			break;
			
		case GPLAYER_PAUSE:
			hwnd->draw_info[1].draw_data = (INT32U)ICON_INFO_PAUSE;
			hwnd->draw_info[4].draw_data = (INT32U)0;
			AudioStatus = AUDIO_PAUSE;
			break;
			
		case GPLAYER_STOP:
			hwnd->draw_info[1].draw_data = (INT32U)ICON_INFO_BLANK;
			hwnd->draw_info[4].draw_data = (INT32U)ICON_INFO_BLANK;
/*
	                file_index = pList->filelist_items[pList->focused_item_index].filelist_item_id ;
	                item_name = GetFullName(file_index, &item_type) ;
	                Get_FileInfo(item_name);
	                item_type = GetMediaType(item_name);
			  ShowFileInfor();
*/
			AudioStatus = AUDIO_STOP;
			break;

		case GPLAYER_QUIT:
			hwnd->draw_info[1].draw_data = (INT32U)ICON_INFO_BLANK;
			hwnd->draw_info[4].draw_data = (INT32U)ICON_INFO_BLANK;
	                file_index = pList->filelist_items[pList->focused_item_index].filelist_item_id ;
	                item_name = GetFullName(file_index, &item_type) ;
	                Get_FileInfo(item_name);
	                item_type = GetMediaType(item_name);
			  #ifdef ENABLE_NETWORK
            if(!notshowinfo)
            ShowFileInfor();
            notshowinfo = 0;
#else
            ShowFileInfor();
#endif

			break;
			
		case GPLAYER_SEAMLESS_FF:
			hwnd->draw_info[1].draw_data = (INT32U)ICON_INFO_FF;
			
			if(ff_level == 2)
			{
				hwnd->draw_info[4].draw_data = (INT32U)ICON_2_MUSIC;
				AudioStatus = AUDIO_FAST_FOR_1;
			}
			else
			if(ff_level == 3)
			{
				hwnd->draw_info[4].draw_data = (INT32U)ICON_4_MUSIC;
				AudioStatus = AUDIO_FAST_FOR_2;
			}
			else
			if(ff_level == 4)
			{
				hwnd->draw_info[4].draw_data = (INT32U)ICON_8_MUSIC;
				AudioStatus = AUDIO_FAST_FOR_3;
			}
			break;
			
		case GPLAYER_SEAMLESS_FB:
			hwnd->draw_info[1].draw_data = (INT32U)ICON_INFO_FB;
			
			if(fb_level == 2)
			{
				hwnd->draw_info[4].draw_data = (INT32U)ICON_2_MUSIC;
				AudioStatus = AUDIO_FAST_BACK_1 ;
			}
			else
			if(fb_level == 3)
			{
				hwnd->draw_info[4].draw_data = (INT32U)ICON_4_MUSIC;
				AudioStatus = AUDIO_FAST_BACK_2;
			}
			else
			if(fb_level == 4)
			{
				hwnd->draw_info[4].draw_data = (INT32U)ICON_8_MUSIC;
				AudioStatus = AUDIO_FAST_BACK_3 ;
			}
			break;
			
		default:
			break;
	}
	hwnd->pClass->ClassProc(hwnd, WM_PAINT_DRAW_INFO, 1);
	hwnd->pClass->ClassProc(hwnd, WM_PAINT_DRAW_INFO, 4);
	hwnd->pClass->ClassProc(hwnd, WM_PAINT_FINISH, 0);
}	


static void caption_moving_time_func_3(void *arg)
{
    PHWND hwnd=(PHWND)arg;
    AWPostMessage(hwnd, WM_PAINT_DRAW_INFO, 3) ;
    AVSysEvent_Post(gAppAgrs[gAWGUIAppID].app_event_handle) ;
}

static void caption_moving_time_func_2(void *arg)
{
    PHWND hwnd=(PHWND)arg;
    AWPostMessage(hwnd, WM_PAINT_DRAW_INFO, 5) ;
    AVSysEvent_Post(gAppAgrs[gAWGUIAppID].app_event_handle) ;
}
static void caption_moving_time_func_1(void *arg)
{
    PHWND hwnd=(PHWND)arg;
    AWPostMessage(hwnd, WM_PAINT_DRAW_INFO, 1) ;
    AVSysEvent_Post(gAppAgrs[gAWGUIAppID].app_event_handle) ;
}


INT8U Check_string_is_roll_file(void)
{
	if(String_roll_state_file == ROLL)
		return	ROLL ;
	else
	if(String_roll_state_file == UNROLL)
		return UNROLL ;
	else
		return UNROLL ;
}


void FileListViewStringRollDelaySecond_file()
{
	PHWND dir_hwnd = AWFindWinCtrlByName(StringRotate);
	PHWND hwnd = AWFindWinCtrlByName(FileListPreview);
	TFILELIST *pList = (TFILELIST *)hwnd ;
	char *item_name;
	INT32U file_index ;
	INT32U item_type ;

	if((!dir_hwnd)||(!hwnd))
		return ;
	
	char t[256] ;
	if(t)
		memset(t,0,256);
	else
		return ;

	if(file_info_onshow.file_name[0] == 0)
	{
                file_index = pList->filelist_items[pList->focused_item_index].filelist_item_id ;
                item_name = GetFullName(file_index, &item_type) ;
                Get_FileInfo(item_name);
		  g_item_name = item_name;
                item_type = GetMediaType(item_name);

		if(item_name)
			snprintf( t,sizeof(t), "%s", strrchr(item_name, '/')+1 );				
	}
	else

		snprintf(t,sizeof(t),"%s",file_info_onshow.file_name);

	dir_hwnd->winrect.top = hwnd->winrect.top + ((pList->focused_item_index+7-pList->first_item_index)%7)*(hwnd->winrect.height/7);
	dir_hwnd->winrect.left = hwnd->winrect.left + pList->filelist_title_start_x ;
	dir_hwnd->draw_info[0].draw_pos_x = hwnd->winrect.left + pList->filelist_title_start_x ;
	dir_hwnd->draw_info[0].draw_pos_y = hwnd->winrect.top + ((pList->focused_item_index+7-pList->first_item_index)%7)*(hwnd->winrect.height/7) ;

	dir_hwnd->draw_info[0].draw_data = (INT32U)ICON_PLAYLIST_BAR_FOCUS_ROLLSTRING ;
	dir_hwnd->pClass->ClassProc(dir_hwnd, WM_PAINT_DRAW_INFO, 0);
	dir_hwnd->pClass->ClassProc(dir_hwnd, WM_PAINT_FINISH, 0);

	vosd_selfroll_string(dir_hwnd, 
						 1, 
						 t, 
						 0, 
						 pList->filelist_title_start_y, 
						 &caption_moving_timer_1, 
						 caption_moving_time_func_1, 
						 Filelist_Bar_Str_len  ,
						 MOVING_VOSD_LEFT_ROLL, 
						 UNROLL
						 );
	
	String_roll_state_file = ROLL ;

}

INT8U Focus2FileList_FromControl(char *Control_name)
{
    PHWND dir_hwnd =NULL;
    
    dir_hwnd = AWFindWinCtrlByName(Control_name);
    if(AWIsFocusWinControl(dir_hwnd) && dir_hwnd)
    {
        dir_hwnd->style |=WS_DISVISIBLE;
        dir_hwnd = AWFindWinCtrlByName(FileListPreview) ;
        if(dir_hwnd)
            AWSetFocus(dir_hwnd) ;
        return 1;    
    }
    return 0;
}

void SwitchFocus_UnMount(void)
{
    if(Focus2FileList_FromControl(WinFileListCopyDelBKG))
        del_flag =0;
    Focus2FileList_FromControl(WinFileListUpgrade);
    Focus2FileList_FromControl(WinFileListCopyDel);
}

